Getting matching attribute(s) result and other meta-data

111 views
Skip to first unread message

Nicolas Buduroi

unread,
Apr 20, 2012, 11:00:34 AM4/20/12
to thinkin...@googlegroups.com
Hi, I would like to use Sphinx with Soulmate and I'd need to provide the attribute matching the search term, is there a way to get that from the results?

I also wonder what kind of meta-data Sphinx provide with the results and where is it documented?

Pat Allan

unread,
Apr 21, 2012, 12:33:40 AM4/21/12
to thinkin...@googlegroups.com
Hi Nicolas

Sphinx does not tell you which fields match - at least, not easily. You can sort by what it calls the fieldmask value, which can then be used to determine which field had the matching value - but then that removes the option of sorting by anything else.

You could also use the excerpts feature to highlight matching words (like Google does), but not sure if that's exactly what you're after?

As for the information Sphinx generally provides with search results - you get all attribute values for each document, plus the weight/relevance score for each, the number of results matching, error and warning information, the time the query took, a list of attributes and their types, and stats on each keyword in the search (how many documents matched, how many matches across all matching documents).

Hope this is helpful.

--
Pat

On 21/04/2012, at 1:00 AM, Nicolas Buduroi wrote:

> Hi, I would like to use Sphinx with Soulmate and I'd need to provide the attribute matching the search term, is there a way to get that from the results?
>
> I also wonder what kind of meta-data Sphinx provide with the results and where is it documented?
>

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/thinking-sphinx/-/1V-uDPPl9lwJ.
> 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=en.

senthil kumar

unread,
Apr 29, 2012, 6:39:05 PM4/29/12
to Thinking Sphinx
>>>>and stats on each keyword in the search (how many documents matched, how many matches across all matching documents).

Assumption: All set- good to go.

Here's an example search term. "fiction hardcover 2011"

Im querying this "Table",

id | title
1| literature and fiction
2| arts
3| photography

This is my query,

Table.search '"fiction hardcover 2011"/1', :match_mode => :extended

What I want?

For the above query, the result would be " 1 | literature and fiction
", but the sub-search term "fiction" was the key(by sphinx) used to
fetch "literature and fiction".

Will that sub search term which matched a document be returned by
sphinx. Or how do i access it via thinking_sphinx?



Pat Allan

unread,
Apr 29, 2012, 8:26:51 PM4/29/12
to thinkin...@googlegroups.com
You can obtain the raw Sphinx results like so:

Table.search('"fiction hardcover 2011"/1', :match_mode => :extended).results

Have a look through what's there, see if it gives you the information you need.

Cheers

--
Pat
> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
Reply all
Reply to author
Forward
0 new messages