• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

Lucene Index filter

Hi,

I want to filter on lucene index.
where in the results should not contain array of string. The array can have length upto 10000. (Array string are input from user at runtime so we can not cache or store.)
How do i add filter.
If i add
NOT Name:xyz AND NOT Name:abc AND NOT Name:pqr .....

The query length will be too large.

Any suggestion for optimizing this.

Thanks
0
BHUSHANGEETE
Asked:
BHUSHANGEETE
1 Solution
 
valipotorCommented:
Just a thought, it might help you:

Build a filter programatically:

BooleanFilter booleanFilter = new BooleanFilter();
//add conditions
booleanFilter.add(new FilterClause(getTermsFilter("Name","abc"),BooleanClause.Occur.MUST_NOT));
booleanFilter.add(new FilterClause(getTermsFilter("Name","pqr"),BooleanClause.Occur.MUST_NOT));
...

//perform filtering
BitSet bits = booleanFilter.bits(reader);

valipotor

0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now