You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jason Brown <Ja...@sjp.co.uk> on 2010/10/22 13:20:56 UTC

facet Prefix (or term prefix)

I am aware of the facet.prefix facility. I am using SOLR to return a facetted fields contents - I use the facet.prefix to restrict what returns from SOLR - this is very useful for predictive search functionality (autocomplete).

My only issue is that the field I facet on is a string and could have 2 or 3 words in it, thus this process will only return strings that begin with what the user is typing into my UI search box. It would be useful if I could get facets back where I could match somewhere in the facetted field (not just at the begninning), i.e. is there a fact.contains method?

If not I'll just have to code this in my service layer having received all facets from SOLR (without the prefix)

Thanks for any help.




If you wish to view the St. James's Place email disclaimer, please use the link below

http://www.sjp.co.uk/portal/internet/SJPemaildisclaimer

Re: facet Prefix (or term prefix)

Posted by Markus Jelsma <ma...@openindex.io>.
Hi,

There is no facet.contains facility there are alternatives. Instead of using 
the faceting engine, you will need to create a field that has an 
NGramTokenizer.  Properly configured, you can use this field to query upon and 
it will return what you would expect from a facet.contains feature.

Here's a post on the subject which you may find useful:
http://www.lucidimagination.com/blog/2009/09/08/auto-suggest-from-popular-
queries-using-edgengrams/

Cheers,

On Friday 22 October 2010 13:20:56 Jason Brown wrote:
> I am aware of the facet.prefix facility. I am using SOLR to return a
> facetted fields contents - I use the facet.prefix to restrict what returns
> from SOLR - this is very useful for predictive search functionality
> (autocomplete).
> 
> My only issue is that the field I facet on is a string and could have 2 or
> 3 words in it, thus this process will only return strings that begin with
> what the user is typing into my UI search box. It would be useful if I
> could get facets back where I could match somewhere in the facetted field
> (not just at the begninning), i.e. is there a fact.contains method?
> 
> If not I'll just have to code this in my service layer having received all
> facets from SOLR (without the prefix)
> 
> Thanks for any help.
> 
> 
> 
> 
> If you wish to view the St. James's Place email disclaimer, please use the
> link below
> 
> http://www.sjp.co.uk/portal/internet/SJPemaildisclaimer

-- 
Markus Jelsma - CTO - Openindex
http://www.linkedin.com/in/markus17
050-8536600 / 06-50258350