Package org.sindice.siren.search.node

Examples of org.sindice.siren.search.node.NodePhraseQuery$NodePhraseWeight


  public static class NodePhraseQueryBuilder extends NodeQueryBuilder {

    protected final NodePhraseQuery npq;

    private NodePhraseQueryBuilder(final String fieldName, final String[] terms) {
      npq = new NodePhraseQuery();
      for (int i = 0; i < terms.length; i++) {
        if (terms[i].isEmpty()) { // if empty string, skip it
          continue;
        }
        final Term t = new Term(fieldName, terms[i]);
View Full Code Here


  }

  public NodePhraseQuery build(final QueryNode queryNode) throws QueryNodeException {
    final TokenizedPhraseQueryNode phraseNode = (TokenizedPhraseQueryNode) queryNode;

    final NodePhraseQuery phraseQuery = new NodePhraseQuery();
    final List<QueryNode> children = phraseNode.getChildren();

    if (children != null) {
      for (final QueryNode child : children) {
        final NodeTermQuery termQuery = (NodeTermQuery) child
            .getTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
        final FieldQueryNode termNode = (FieldQueryNode) child;
        phraseQuery.add(termQuery.getTerm(), termNode.getPositionIncrement());
      }
    }
    return phraseQuery;
  }
View Full Code Here

TOP

Related Classes of org.sindice.siren.search.node.NodePhraseQuery$NodePhraseWeight

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.