Package org.sindice.siren.qparser.keyword

Examples of org.sindice.siren.qparser.keyword.KeywordQueryParser


  public JsonQueryParser() {
    super(new JsonQueryConfigHandler(), new JsonSyntaxParser(),
      new JsonQueryNodeProcessorPipeline(null),
      new JsonQueryTreeBuilder(null));

    final KeywordQueryParser keywordParser = this.getKeywordQueryParser();
    // ensure that the default operator of the keyword parser is in synch
    keywordParser.setDefaultOperator(this.getDefaultOperator());

    // configure builders with the keyword parser
    final JsonQueryTreeBuilder builder = (JsonQueryTreeBuilder) this.getQueryBuilder();
    builder.setBuilders(keywordParser);
  }
View Full Code Here


   */
  public void setDefaultOperator(final Operator operator) {
    this.getQueryConfigHandler().set(ConfigurationKeys.DEFAULT_OPERATOR, operator);

    // ensure that the default operator of the keyword parser is in synch
    final KeywordQueryParser keywordParser = this.getKeywordQueryParser();
    keywordParser.setDefaultOperator(this.getDefaultOperator());
  }
View Full Code Here

  @Override
  public void setQueryConfigHandler(final QueryConfigHandler config) {
    super.setQueryConfigHandler(config);

    final KeywordQueryParser keywordParser = this.getKeywordQueryParser();
    // ensure that the default operator of the keyword parser is in synch
    keywordParser.setDefaultOperator(this.getDefaultOperator());

    // configure builders with the keyword parser
    final JsonQueryTreeBuilder builder = (JsonQueryTreeBuilder) this.getQueryBuilder();
    builder.setBuilders(keywordParser);
  }
View Full Code Here

  public JsonQueryConfigHandler() {
    // Set default operator
    this.set(ConfigurationKeys.DEFAULT_OPERATOR, Operator.AND);

    // Set default keyword parser
    final KeywordQueryParser parser = new KeywordQueryParser();
    // Disable twig queries: syntactic sugar for twig queries must be disabled
    // in the JSON parser
    parser.setAllowTwig(false);
    // set default operator
    parser.setDefaultOperator(Operator.AND);
    this.set(ConfigurationKeys.KEYWORD_PARSER, parser);
  }
View Full Code Here

      searcher = null;
    }
  }

  public Query parseKeywordQuery(final String keywordQuery) throws QueryNodeException {
    final KeywordQueryParser parser = new KeywordQueryParser();
    parser.setDatatypeAnalyzers(this.getDatatypeAnalyzers());
    return parser.parse(keywordQuery, SimpleIndexer.DEFAULT_SIREN_FIELD);
  }
View Full Code Here

    return parser.parse(keywordQuery, SimpleIndexer.DEFAULT_SIREN_FIELD);
  }

  public Query parseJsonQuery(final String JsonQuery) throws QueryNodeException {
    final JsonQueryParser parser = new JsonQueryParser();
    final KeywordQueryParser kParser = new KeywordQueryParser();
    kParser.setDatatypeAnalyzers(this.getDatatypeAnalyzers());
    kParser.setAllowTwig(false);
    parser.setKeywordQueryParser(kParser);
    return parser.parse(JsonQuery, SimpleIndexer.DEFAULT_SIREN_FIELD);
  }
View Full Code Here

  }

  @Override
  protected Query parse(final String field, final String qstr,
                        final Map<String, Analyzer> datatypeConfig) {
    final KeywordQueryParser parser = new KeywordQueryParser();
    parser.setDefaultOperator(this.getDefaultOperator());
    parser.setQNames(qnames);
    parser.setDatatypeAnalyzers(datatypeConfig);

    try {
      return parser.parse(qstr, field);
    }
    catch (final QueryNodeException e) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
    }
  }
View Full Code Here

TOP

Related Classes of org.sindice.siren.qparser.keyword.KeywordQueryParser

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.