I have used sphinx indexing on 2 tables in my products catalog app.
namely,
"titles" and "features"
For every search_key, I will check the titles table first and if no
results found,
I will goto features table. If a title match is found I will stop and
i will not goto features table.
Example: search keyword is "head and dust hachette book publishing",
Here, "heat and dust" has an exact match in titles so im not going to
the features table.
Question:
How to find the unmatched_keys for a search in sphinx..?
I want to find out the unmatched words in the search key i.e.
"hachette book publishing" in "head and dust hachette book
publishing"..
If I get that, I will check if @unmatched_title_keys is nil?.. if
not.. I will goto features table and perform a feature search for
@unmatched_title_keys.
Please advice if this approach for searching 2 tables is good or I
should alter my search approach and tell me how to retrieve
unmatched_keys from a sphinx search query...
> I have used sphinx indexing on 2 tables in my products catalog app.
> namely,
> "titles" and "features"
> For every search_key, I will check the titles table first and if no
> results found,
> I will goto features table. If a title match is found I will stop and
> i will not goto features table.
> Example: search keyword is "head and dust hachette book publishing",
> Here, "heat and dust" has an exact match in titles so im not going to
> the features table.
> Question:
> How to find the unmatched_keys for a search in sphinx..?
> I want to find out the unmatched words in the search key i.e.
> "hachette book publishing" in "head and dust hachette book
> publishing"..
> If I get that, I will check if @unmatched_title_keys is nil?.. if
> not.. I will goto features table and perform a feature search for
> @unmatched_title_keys.
> Please advice if this approach for searching 2 tables is good or I
> should alter my search approach and tell me how to retrieve
> unmatched_keys from a sphinx search query...
> I have used sphinx indexing on 2 tables in my products catalog app. > namely,
> "titles" and "features"
> For every search_key, I will check the titles table first and if no > results found, > I will goto features table. If a title match is found I will stop and > i will not goto features table.
> Example: search keyword is "head and dust hachette book publishing",
> Here, "heat and dust" has an exact match in titles so im not going to > the features table.
> Question:
> How to find the unmatched_keys for a search in sphinx..?
> I want to find out the unmatched words in the search key i.e. > "hachette book publishing" in "head and dust hachette book > publishing"..
> If I get that, I will check if @unmatched_title_keys is nil?.. if > not.. I will goto features table and perform a feature search for > @unmatched_title_keys.
> Please advice if this approach for searching 2 tables is good or I > should alter my search approach and tell me how to retrieve > unmatched_keys from a sphinx search query...
> -- > You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. > To post to this group, send email to thinking-sphinx@googlegroups.com. > To unsubscribe from this group, send email to thinking-sphinx+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
> sphinx_result.results[:words].keys.each do |i|
> if sphinx_result.results[:words][i][:hits] == 0
> @unmatched_keywords << i
> end
> end
> Now the value of @unmatched_keywords is ["hachette", "book",
> "publishing"].
> I get what I want.
> Kindly validate.
> Thanks,
> Senthil.
> -- > You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To post to this group, send email to thinking-sphinx@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphinx+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.