You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Evert Wagenaar <ev...@gmail.com> on 2018/07/23 14:53:04 UTC

WildcardQuery question

Hello all,

I have a WebApp (see http://ejwagenaar.com/index.php/Lingoweb/) which makes
extensive use of wildcardquery. I want to enable the first character(s)
too. How can I enable this?

Many thanks,

Evert Wagenaar
-- 
Sent from Gmail IPad

Re: WildcardQuery question

Posted by Evert Wagenaar <ev...@gmail.com>.
Thanks Eric,

To get the terms I use

parser.setMultiTermRewriteMethod(MultiTermQuery.
CONSTANT_SCORE_BOOLEAN_REWRITE);
So I'm rewriting the Query. I already passed the MaxClauseCont which I
could solve by setting.
I already did raise the MaxClauseCount to 4000 to avoid errors.

 Thanks,

Evert

On Mon, Jul 23, 2018 at 10:28 PM Erick Erickson <er...@gmail.com>
wrote:

> This just implements ReversedWildcardFilter, which while also in Solr
> should be readily adaptable to lucene-only.
>
> In general you want to do some trick like this. Otherwise it doesn't
> scale well as conceptually Lucene has to enumerate
> _all_ the terms to assemble the actual list of contained terms. I.e.
> say you are searching for
>
> *what
>
> There's no way to know what terms match unless you look at them all,
> which doesn't scale when the number of terms
> gets huge.
>
> You might be able to do something with ngrams too.
>
> Best,
> Erick
>
> On Mon, Jul 23, 2018 at 12:07 PM, Evert Wagenaar
> <ev...@gmail.com> wrote:
> > Thanks Eric,
> >
> > I see only Solr documents in there. My solution is 100% Lucene.
> >
> > Regards,
> >
> > Evert
> >
> > On Mon, Jul 23, 2018 at 7:56 PM Erick Erickson <er...@gmail.com>
> > wrote:
> >
> >> Take a look at ReverseWilcardFilterFactory:
> >>
> >> https://lucene.apache.org/solr/guide/6_6/filter-descriptions.html
> >>
> >> Best,
> >> Erick
> >>
> >> On Mon, Jul 23, 2018 at 7:53 AM, Evert Wagenaar
> >> <ev...@gmail.com> wrote:
> >> > Hello all,
> >> >
> >> > I have a WebApp (see http://ejwagenaar.com/index.php/Lingoweb/) which
> >> makes
> >> > extensive use of wildcardquery. I want to enable the first
> character(s)
> >> > too. How can I enable this?
> >> >
> >> > Many thanks,
> >> >
> >> > Evert Wagenaar
> >> > --
> >> > Sent from Gmail IPad
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >> --
> > Sent from Gmail IPad
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: WildcardQuery question

Posted by Erick Erickson <er...@gmail.com>.
This just implements ReversedWildcardFilter, which while also in Solr
should be readily adaptable to lucene-only.

In general you want to do some trick like this. Otherwise it doesn't
scale well as conceptually Lucene has to enumerate
_all_ the terms to assemble the actual list of contained terms. I.e.
say you are searching for

*what

There's no way to know what terms match unless you look at them all,
which doesn't scale when the number of terms
gets huge.

You might be able to do something with ngrams too.

Best,
Erick

On Mon, Jul 23, 2018 at 12:07 PM, Evert Wagenaar
<ev...@gmail.com> wrote:
> Thanks Eric,
>
> I see only Solr documents in there. My solution is 100% Lucene.
>
> Regards,
>
> Evert
>
> On Mon, Jul 23, 2018 at 7:56 PM Erick Erickson <er...@gmail.com>
> wrote:
>
>> Take a look at ReverseWilcardFilterFactory:
>>
>> https://lucene.apache.org/solr/guide/6_6/filter-descriptions.html
>>
>> Best,
>> Erick
>>
>> On Mon, Jul 23, 2018 at 7:53 AM, Evert Wagenaar
>> <ev...@gmail.com> wrote:
>> > Hello all,
>> >
>> > I have a WebApp (see http://ejwagenaar.com/index.php/Lingoweb/) which
>> makes
>> > extensive use of wildcardquery. I want to enable the first character(s)
>> > too. How can I enable this?
>> >
>> > Many thanks,
>> >
>> > Evert Wagenaar
>> > --
>> > Sent from Gmail IPad
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>> --
> Sent from Gmail IPad

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: WildcardQuery question

Posted by Evert Wagenaar <ev...@gmail.com>.
Thanks Eric,

I see only Solr documents in there. My solution is 100% Lucene.

Regards,

Evert

On Mon, Jul 23, 2018 at 7:56 PM Erick Erickson <er...@gmail.com>
wrote:

> Take a look at ReverseWilcardFilterFactory:
>
> https://lucene.apache.org/solr/guide/6_6/filter-descriptions.html
>
> Best,
> Erick
>
> On Mon, Jul 23, 2018 at 7:53 AM, Evert Wagenaar
> <ev...@gmail.com> wrote:
> > Hello all,
> >
> > I have a WebApp (see http://ejwagenaar.com/index.php/Lingoweb/) which
> makes
> > extensive use of wildcardquery. I want to enable the first character(s)
> > too. How can I enable this?
> >
> > Many thanks,
> >
> > Evert Wagenaar
> > --
> > Sent from Gmail IPad
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
> --
Sent from Gmail IPad

Re: WildcardQuery question

Posted by Erick Erickson <er...@gmail.com>.
Take a look at ReverseWilcardFilterFactory:

https://lucene.apache.org/solr/guide/6_6/filter-descriptions.html

Best,
Erick

On Mon, Jul 23, 2018 at 7:53 AM, Evert Wagenaar
<ev...@gmail.com> wrote:
> Hello all,
>
> I have a WebApp (see http://ejwagenaar.com/index.php/Lingoweb/) which makes
> extensive use of wildcardquery. I want to enable the first character(s)
> too. How can I enable this?
>
> Many thanks,
>
> Evert Wagenaar
> --
> Sent from Gmail IPad

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org