extract substring

9 views
Skip to first unread message

pcasa

unread,
Nov 23, 2009, 8:44:01 AM11/23/09
to Thinking Sphinx
I have product that the product serial number equals product series,
chip, model, manufacture, software, etc. Each of these has its own
table with all the information I need in it.

Each product serial number is 8 characters long. i.e. 1B43A672,
18GH8843. The second value determines how to map the serial number to
which table. i.e. If the second value is B then that is a Intel Atom
1.6 and its mapped like this: Position_1 == @series; Position_2 ==
@processor; Position_3 == @model

But if second value is 8 then its mapped like this: Position_1 ==
@manufacture;Position_2 == @processor; Position_3 == @software

Can thinking sphinx do this?

Pat Allan

unread,
Nov 25, 2009, 12:08:35 AM11/25/09
to thinkin...@googlegroups.com
Sorry, I'm not exactly sure what you're asking...

If you need Sphinx to filter by specific characters in the serial
number, then you'll need to parse out each piece of information via
SQL snippets... something like (I'm guessing here):
has "SUBSTR(serial_number, 0, 1)", :as => :manufacturer, :type
=> :integer

It does seem like your logic is more complex than this, but if you
want to get the data into Sphinx, it all needs to be managed by SQL
queries.

If this isn't a question to do with indexing, please let me know and
I'll try to provide some other suggestions.

--
Pat
> --
>
> You received this message because you are subscribed to the Google
> Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=
> .
>
>

Reply all
Reply to author
Forward
0 new messages