lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ridwan Habbal <>
Subject How to search over all fields in a clean way?
Date Wed, 15 Aug 2007 09:38:46 GMT
Hello all, 
when we search over an index docs we use code such:
Analyzer analyzer = new StandardAnalyzer();
String defaultSearchField = "all";
QueryParser parser = new QueryParser(defaultSearchField, analyzer);
IndexSearcher indexSearcher = new IndexSearcher(this.indexDirectory);
Hits hits =;
The problem is when you want to search over ALL fields in each doc. What's more is that the
fields are created dynamically. In other words, The number and identifiers of the fields of
my docs vary from each other. so it's irrational to type all fields names, further more i
don't know them. 
I thought of a primitive solution: copy all fields to one field, however this doubles the
index size, and it might conflict with some fields names since the fields of docs are dynamic.

could some one help me? 
Thanks in advance. 
Explore the seven wonders of the world
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message