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 neosky <ne...@yahoo.com> on 2012/04/06 04:11:32 UTC

A little onfusion with maxPosAsterisk

maxPosAsterisk - maximum position (1-based) of the asterisk wildcard ('*')
that triggers the reversal of query term. Asterisk that occurs at positions
higher than this value will not cause the reversal of query term. Defaults
to 2, meaning that asterisks on positions 1 and 2 will cause a reversal.

I can't understand that "will cause a reversal." 
I know the Solr will keep the original token and reverse token when
withOriginal parameter is open
Does that means the searcher will use the reverse one to help to process the
query when "cause a reversal"? 

--
View this message in context: http://lucene.472066.n3.nabble.com/A-little-onfusion-with-maxPosAsterisk-tp3889226p3889226.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: A little onfusion with maxPosAsterisk

Posted by neosky <ne...@yahoo.com>.
great! thanks!

--
View this message in context: http://lucene.472066.n3.nabble.com/A-little-onfusion-with-maxPosAsterisk-tp3889226p3890776.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: A little onfusion with maxPosAsterisk

Posted by Dmitry Kan <dm...@gmail.com>.
Let's first figure out, why reversing a token is helpful for doing leading
wildcard searches. I'll assume you refer to ReversedWildcardFilterFactory.

If you have the query *foo, using a straightforward approach, you would
need to scan through the entire dictionary of terms (which can be billions)
in your solr index and try to match the suffix foo (which can start with
any prefix) => very time consuming and non-optimal.

If we used the ReversedWildcardFilterFactory instead, it would reverse
every token in the index and store both:

koongfoo (original token)

and

oofgnook (reversed token)

Now when searching with *foo, we could also reverse it to oof* and only
scan part of the dictionary, with terms starting with letter o, and
further, if applying some binary search, we could directly jump to tokens
that have oof as their prefix. Thus we have turned ineffective suffix
search into effective prefix search.

Back to your question:

maxPosAsterisk parameter controls when should an ineffective suffix query
term should be identified and effective prefix query term generated from
it. It says, that both *foo and f*oo (as an example) should be treated as
suffix queries to be turned into prefix queries oof* and oo*f.

Hope this helps.

Dmitry

On Fri, Apr 6, 2012 at 5:11 AM, neosky <ne...@yahoo.com> wrote:

> maxPosAsterisk - maximum position (1-based) of the asterisk wildcard ('*')
> that triggers the reversal of query term. Asterisk that occurs at positions
> higher than this value will not cause the reversal of query term. Defaults
> to 2, meaning that asterisks on positions 1 and 2 will cause a reversal.
>
> I can't understand that "will cause a reversal."
> I know the Solr will keep the original token and reverse token when
> withOriginal parameter is open
> Does that means the searcher will use the reverse one to help to process
> the
> query when "cause a reversal"?
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/A-little-onfusion-with-maxPosAsterisk-tp3889226p3889226.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,

Dmitry Kan