Java Code Examples for org.apache.lucene.util.QueryBuilder

The following examples show how to use org.apache.lucene.util.QueryBuilder. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: cxf   Source File: LuceneQueryVisitor.java    License: Apache License 2.0 5 votes vote down vote up
public LuceneQueryVisitor(Map<String, String> fieldsMap, String contentsFieldName, Analyzer analyzer) {
    super(fieldsMap);
    this.contentsFieldName = contentsFieldName;

    if (analyzer != null) {
        queryBuilder = new QueryBuilder(analyzer);
    }

}
 
Example 2
static Query parseFieldQuery(QParser parser, Analyzer analyzer, String field, String queryText)
{
    // note, this method always worked this way (but nothing calls it?) because it has no idea of quotes...
    return new QueryBuilder(analyzer).createPhraseQuery(field, queryText);
}
 
Example 3
private PhraseQuery newPhraseQuery(String field, String phrase) {
  return (PhraseQuery) new QueryBuilder(indexAnalyzer).createPhraseQuery(field, phrase);
}
 
Example 4
Source Project: lucene-solr   Source File: LengthGoalBreakIteratorTest.java    License: Apache License 2.0 4 votes vote down vote up
private Query query(String qStr) {
  return new QueryBuilder(analyzer).createBooleanQuery(FIELD, qStr);
}
 
Example 5
Source Project: lucene-solr   Source File: TextField.java    License: Apache License 2.0 4 votes vote down vote up
static Query parseFieldQuery(QParser parser, Analyzer analyzer, String field, String queryText) {
  // note, this method always worked this way (but nothing calls it?) because it has no idea of quotes...
  return new QueryBuilder(analyzer).createPhraseQuery(field, queryText);
}