Trind
Trind

Reputation: 1599

Search over MultiFields lucene

Hi have an application that will have loads of diffrent MetaData fields. They expect to have about 5 000 - 10 000 fields.

Is it possible to search over all thease fields at once with lucene, without indexing them into one field?

MultiFieldQueryParser generated a query with every singel field, wich default luecene is set to around 1000 combined queries at once if i am not wrong?

is there any other parser that searches all fields?

//Trind

Upvotes: 2

Views: 167

Answers (1)

Xodarap
Xodarap

Reputation: 11849

No, if you have multiple fields and want to search them all, you will have to, well, search them all.

In theory, there is no performance detriment to searching lots of small fields vs. one big one:

To put it another way: for standard disjunctive (OR'd) queries, the number of clauses doesn't really affect performance, except to the extent that more documents are potential matches

In practice, you might see some issues; I'm not sure. I'd try it though before assuming you need to index them all into one.

(The maximum number of clauses is 1024 by default, but you can change this via setMaxClauseCount.)

Upvotes: 2

Related Questions