Package org.apache.lucene.queries

Examples of org.apache.lucene.queries.FilterClause


                    case 7:
                    case 6:
                    case 5:
                        hasMust = true;
                        if (rarely()) {
                            clauses[i] = new FilterClause(new EmptyFilter(), MUST);
                            topLevel.add(new BooleanClause(new MatchNoDocsQuery(), MUST));
                        } else {
                            clauses[i] = newFilterClause(field, value, MUST, random().nextBoolean());
                            topLevel.add(new BooleanClause(new TermQuery(new Term(String.valueOf(field), String.valueOf(value))), MUST));
                        }
                        break;
                    case 4:
                    case 3:
                    case 2:
                    case 1:
                        hasShould = true;
                        if (rarely()) {
                            clauses[i] = new FilterClause(new EmptyFilter(), SHOULD);
                            orQuery.add(new BooleanClause(new MatchNoDocsQuery(), SHOULD));
                        } else {
                            clauses[i] = newFilterClause(field, value, SHOULD, random().nextBoolean());
                            orQuery.add(new BooleanClause(new TermQuery(new Term(String.valueOf(field), String.valueOf(value))), SHOULD));
                        }
                        break;
                    case 0:
                        hasMustNot = true;
                        if (rarely()) {
                            clauses[i] = new FilterClause(new EmptyFilter(), MUST_NOT);
                            topLevel.add(new BooleanClause(new MatchNoDocsQuery(), MUST_NOT));
                        } else {
                            clauses[i] = newFilterClause(field, value, MUST_NOT, random().nextBoolean());
                            topLevel.add(new BooleanClause(new TermQuery(new Term(String.valueOf(field), String.valueOf(value))), MUST_NOT));
                        }
View Full Code Here

TOP

Related Classes of org.apache.lucene.queries.FilterClause

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.