Reputation: 26121
Let's assume I search for "developer" in a field, I get 1000 results & for "Php Developer" I get 1500 results.
My query returns facets like:
The above facets means that there are 16 documents with the exact match of "Php Developer" & 15 documents with the exact match of "Web Developer" and so on.
I want these facets to be representing the "actual number of search results" if someone searches for "Developer".
How can I make my facets to represent the number of results NOT the number of exact matches.
Upvotes: 0
Views: 664
Reputation: 9049
My Advice - use your search as it is working currently for you. The facets on partial match seems a bit confusing. People expect partial matches on search results, but exact match on the facets. Facets are more of a "browse" behaviour which allow the users to drill down to specifics. Ambiguity in facets may not allow the users to slice properly.
However, if you still want to use what you are asking for here are some thoughts.
As you mention, the faceting and searching work against different fields, so that can be a cause of this difference.
Faceting works on indexed values, not stored values
So, in order to achieve what you need, you would have to use the exact same fields for searching and faceting.
Also, if you have a catch-all field (copyfield), that would cause this kind of behaviour.
Upvotes: 2