bq: I do not understand why anyone would ever use facet.prefix or
facet.contains for any use other than a development...

Gotta disagree a bit here. AFAIK, it depends on the number of unique
terms in the field. How would either one be worse than facet.field?
And you can freely use facet.field on a very large corpus. The
difficulty with prefix and contains is that you potentially create a
huge number of buckets. If you control that problem, they're perfectly
reasonable.

That said, I totally agree that blindly using either one without
constraints is a fine way to be "surprised" when you unleash it on a
"real" corpus. Especially on, say, text fields.

FWIW

On Thu, Jul 23, 2015 at 2:45 AM, Alessandro Benedetti
<benedetti.ale...@gmail.com> wrote:
> Hi Dave and Markus,
> I would definitely suggest to use the *Suggester Component* .
> In particular, for your use case I suggest the AnalyzingInfixLookup
> strategy .
>
> As usual i suggest :
>
> Erick's post - http://lucidworks.com/blog/solr-suggester/
> My post -
> http://alexbenedetti.blogspot.co.uk/2015/07/solr-you-complete-me.html
> Official Documentation - Suggester Solr wiki
> <https://cwiki.apache.org/confluence/display/solr/Suggester>
>
> Changing the analysis chain Markus can be useful, but probably we would
> need more info from the user to design that.
>
> Cheers
>
>
> 2015-07-23 10:13 GMT+01:00 Markus Jelsma <markus.jel...@openindex.io>:
>
>> Hello - You should index your terms as n-grams indeed, especially for
>> autocompletion. I do not understand why anyone would ever use facet.prefix
>> or facet.contains for any use other than a development tool. It won't
>> perform on any index larger than small.
>>
>> Jan Høydahl has put up a thorough example for any Solr-user can
>> understand  years ago, it'll help you make a decent autocomplete and
>> improve understanding of Lucene and Solr:
>> http://www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/
>>
>> -----Original message-----
>> > From:Lo Dave <dav...@hotmail.com>
>> > Sent: Thursday 23rd July 2015 3:18
>> > To: solr-user@lucene.apache.org
>> > Subject: RE: Performance of facet contain search in 5.2.1
>> >
>> > Yes. I am going to provide autocomplete with facet count as rank.i.e.
>> when yours input "owe a duty", the system will suggest "xxx owe a duty yyy"
>> with highest count.
>> > Thanks.
>> > Dave
>> > > Date: Wed, 22 Jul 2015 14:35:40 +0100
>> > > Subject: Re: Performance of facet contain search in 5.2.1
>> > > From: benedetti.ale...@gmail.com
>> > > To: solr-user@lucene.apache.org
>> > >
>> > > I think as usually Erick says, this is a X-Y problem.
>> > > I think the user was trying to solve the infix autocomplete problem
>> with
>> > > faceting.
>> > >
>> > > We should get from him the initial problem to try to suggest a better
>> > > solution.
>> > >
>> > > Cheers
>> > >
>> > > 2015-07-22 14:01 GMT+01:00 Markus Jelsma <markus.jel...@openindex.io>:
>> > >
>> > > > Hello - why not index the facet field as n-grams? It blows up the
>> index
>> > > > but is very fast!
>> > > > Markus
>> > > >
>> > > > -----Original message-----
>> > > > > From:Erick Erickson <erickerick...@gmail.com>
>> > > > > Sent: Tuesday 21st July 2015 21:36
>> > > > > To: solr-user@lucene.apache.org
>> > > > > Subject: Re: Performance of facet contain search in 5.2.1
>> > > > >
>> > > > > "contains" has to basically examine each and every term to see if
>> it
>> > > > > matches. Say my
>> > > > > facet.contains=bbb. A matching term could be
>> > > > > aaabbbxyz
>> > > > > or
>> > > > > zzzbbbxyz
>> > > > >
>> > > > > So there's no way to _know_ when you've found them all without
>> > > > > examining every last
>> > > > > one. So I'd try to redefine the problem to not require that. If
>> it's
>> > > > > absolutely required,
>> > > > > you can do some interesting things but it's going to inflate your
>> index.
>> > > > >
>> > > > > For instance, "rotate" words (assuming word boundaries here). So,
>> for
>> > > > > instance, you have
>> > > > > a text field with "my dog has fleas". Index things like
>> > > > > my dog has fleas|my dog has fleas
>> > > > > dog has fleas my|my dog has fleas
>> > > > > has fleas my dog|my dog has fleas
>> > > > > fleas my dog has|my dog has fleas
>> > > > >
>> > > > > Literally with the pipe followed by the original text. Now all your
>> > > > > contains clauses are
>> > > > > simple prefix facets, and you can have the UI split the token on
>> the
>> > > > > pipe and display the
>> > > > > original.
>> > > > >
>> > > > > Best,
>> > > > > Erick
>> > > > >
>> > > > > On Tue, Jul 21, 2015 at 1:16 AM, Lo Dave <dav...@hotmail.com>
>> wrote:
>> > > > > > I found that facet contain search take much longer time than
>> facet
>> > > > prefix search. Do anyone have idea how to make contain search faster?
>> > > > > > org.apache.solr.core.SolrCore; [concordance] webapp=/solr
>> path=/select
>> > > >
>> params={q=sentence:"duty+of+care"&facet.field=autocomplete&indent=true&facet.prefix=duty+of+care&rows=1&wt=json&facet=true&_=1437462916852}
>> > > > hits=1856 status=0 QTime=5 org.apache.solr.core.SolrCore;
>> [concordance]
>> > > > webapp=/solr path=/select
>> > > >
>> params={q=sentence:"duty+of+care"&facet.field=autocomplete&indent=true&facet.contains=duty+of+care&rows=1&wt=json&facet=true&facet.contains.ignoreCase=true}
>> > > > hits=1856 status=0 QTime=10951
>> > > > > > As show above, prefix search take 5 but contain search take 10951
>> > > > > > Thanks.
>> > > > > >
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > > --------------------------
>> > >
>> > > Benedetti Alessandro
>> > > Visiting card - http://about.me/alessandro_benedetti
>> > > Blog - http://alexbenedetti.blogspot.co.uk
>> > >
>> > > "Tyger, tyger burning bright
>> > > In the forests of the night,
>> > > What immortal hand or eye
>> > > Could frame thy fearful symmetry?"
>> > >
>> > > William Blake - Songs of Experience -1794 England
>> >
>>
>
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Visiting card - http://about.me/alessandro_benedetti
> Blog - http://alexbenedetti.blogspot.co.uk
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England

Reply via email to