How regular are your patterns? Are they arbitrary? 
What I’m wondering is if you could shift your work the the
indexing end, perhaps even in an auxiliary field. Could you, 
say, just index “paid”, “ms-reply-unpaid” etc? Then there
are no wildcards at all. This akin to “concept search”.

Otherwise ngramming is your best bet.

What’s the field type anyway? Is this field tokenized?

There are lots of options, but soooo much depends on whether
you can process the data such that you won’t need wildcards.

Best,
Erick

> On Jun 29, 2020, at 11:16 AM, Chris Dempsey <cdal...@gmail.com> wrote:
> 
> Hello, all! I'm relatively new to Solr and Lucene (*using Solr 7.7.1*) but
> I'm looking into options for optimizing something like this:
> 
>> fq=(tag:* -tag:*paid*) OR (tag:* -tag:*ms-reply-unpaid*) OR
> tag:*ms-reply-paid*
> 
> It's probably not a surprise that we're seeing performance issues with
> something like this. My understanding is that using the wildcard on both
> ends forces a full-text index search. Something like the above can't take
> advantage of something like the ReverseWordFilter either. I believe
> constructing `n-grams` is an option (*at the expense of index size*) but is
> there anything I'm overlooking as a possible avenue to look into?

Reply via email to