Package org.apache.lucene.index

Examples of org.apache.lucene.index.Term.createTerm()


                    assert hasNext == true;
                    term = termAtt.toString();
                } catch (IOException e) {
                    // safe to ignore, because we know the number of tokens
                }
                Query q = newTermQuery(mapper, termFactory.createTerm(term));
                return wrapSmartNameQuery(q, smartNameFieldMappers, parseContext);
            }
            BooleanQuery q = new BooleanQuery(positionCount == 1);
            for (int i = 0; i < numTokens; i++) {
                String term = null;
View Full Code Here


                    term = termAtt.toString();
                } catch (IOException e) {
                    // safe to ignore, because we know the number of tokens
                }

                Query currentQuery = newTermQuery(mapper, termFactory.createTerm(term));
                q.add(currentQuery, occur);
            }
            return wrapSmartNameQuery(q, smartNameFieldMappers, parseContext);
        } else if (type == Type.PHRASE) {
            if (severalTokensAtSamePosition) {
View Full Code Here

                            mpq.add(multiTerms.toArray(new Term[multiTerms.size()]));
                        }
                        multiTerms.clear();
                    }
                    position += positionIncrement;
                    multiTerms.add(termFactory.createTerm(term));
                }
                if (enablePositionIncrements) {
                    mpq.add(multiTerms.toArray(new Term[multiTerms.size()]), position);
                } else {
                    mpq.add(multiTerms.toArray(new Term[multiTerms.size()]));
View Full Code Here

                        // safe to ignore, because we know the number of tokens
                    }

                    if (enablePositionIncrements) {
                        position += positionIncrement;
                        pq.add(termFactory.createTerm(term), position);
                    } else {
                        pq.add(termFactory.createTerm(term));
                    }
                }
                return wrapSmartNameQuery(pq, smartNameFieldMappers, parseContext);
View Full Code Here

                    if (enablePositionIncrements) {
                        position += positionIncrement;
                        pq.add(termFactory.createTerm(term), position);
                    } else {
                        pq.add(termFactory.createTerm(term));
                    }
                }
                return wrapSmartNameQuery(pq, smartNameFieldMappers, parseContext);
            }
        } else if (type == Type.PHRASE_PREFIX) {
View Full Code Here

                        mpq.add(multiTerms.toArray(new Term[multiTerms.size()]));
                    }
                    multiTerms.clear();
                }
                position += positionIncrement;
                multiTerms.add(termFactory.createTerm(term));
            }
            if (enablePositionIncrements) {
                mpq.add(multiTerms.toArray(new Term[multiTerms.size()]), position);
            } else {
                mpq.add(multiTerms.toArray(new Term[multiTerms.size()]));
View Full Code Here

                    TermDocs tDocs = reader.termDocs();
                    try {
                        ItemStateManager ism = getContext().getItemStateManager();
                        for (UUID uuid : removedUUIDs) {
                            aggregateUUIDs =
                                aggregateUUIDs.createTerm(uuid.toString());
                            tDocs.seek(aggregateUUIDs);
                            while (tDocs.next()) {
                                Document doc = reader.document(
                                        tDocs.doc(), FieldSelectors.UUID);
                                NodeId nId = new NodeId(
View Full Code Here

                    TermDocs tDocs = reader.termDocs();
                    try {
                        ItemStateManager ism = getContext().getItemStateManager();
                        for (UUID uuid : removedUUIDs) {
                            aggregateUUIDs =
                                aggregateUUIDs.createTerm(uuid.toString());
                            tDocs.seek(aggregateUUIDs);
                            while (tDocs.next()) {
                                Document doc = reader.document(
                                        tDocs.doc(), FieldSelectors.UUID);
                                NodeId nId = new NodeId(
View Full Code Here

        //These are spelled the same, continue on
        continue;
      }

      if (extendedResults == true && reader != null && field != null) {
        term = term.createTerm(tokenText);
        result.add(token, reader.docFreq(term));
        int countLimit = Math.min(count, suggestions.length);
        for (int i = 0; i < countLimit; i++) {
          term = term.createTerm(suggestions[i]);
          result.add(token, suggestions[i], reader.docFreq(term));
View Full Code Here

      if (extendedResults == true && reader != null && field != null) {
        term = term.createTerm(tokenText);
        result.add(token, reader.docFreq(term));
        int countLimit = Math.min(count, suggestions.length);
        for (int i = 0; i < countLimit; i++) {
          term = term.createTerm(suggestions[i]);
          result.add(token, suggestions[i], reader.docFreq(term));
        }
      } else {
        if (suggestions.length > 0) {
          List<String> suggList = Arrays.asList(suggestions);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.