Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lucene query size- does this scale? query for '1 OR 2 OR 3 .. OR N'

Tags:

lucene

Suppose I have a lucene query 'id1 OR id2 OR id3 ... idN'. How well does that scale as N increases?

The situation I'm looking at would be similar to someone doing a text search on products in their shopping cart, but they may have hundreds or thousands of items their shopping cart. The user wants to do a text search across all products in their shopping cart. Could I do a text query against all available products, then limit the items returned with a OR clause of product IDs in their cart?

like image 230
Frank Schwieterman Avatar asked Feb 27 '23 10:02

Frank Schwieterman


1 Answers

The maximum number of clauses in a boolean query is 1024 by default. You can increase this limit. There would be performance penalty, though. I suppose, it would be efficient if you use Filters instead.

like image 131
Shashikant Kore Avatar answered Mar 17 '23 04:03

Shashikant Kore