Package org.apache.lucene.index

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


            // lower case character and another one with an initial upper case
            // character
            List rangeScans = new ArrayList(2);
            nameLength = FieldNames.getNameLength(term.text());
            String propName = term.text().substring(0, nameLength);
            this.termText = new OffsetCharSequence(nameLength, term.text());
            this.currentTerm = new OffsetCharSequence(nameLength, term.text(), transform);

            try {
                // start with a term using the lower case character for the first
                // character of the value.
View Full Code Here


            // character
            List rangeScans = new ArrayList(2);
            nameLength = FieldNames.getNameLength(term.text());
            String propName = term.text().substring(0, nameLength);
            this.termText = new OffsetCharSequence(nameLength, term.text());
            this.currentTerm = new OffsetCharSequence(nameLength, term.text(), transform);

            try {
                // start with a term using the lower case character for the first
                // character of the value.
                if (term.text().length() > nameLength) {
View Full Code Here

            this.currentTerm = new OffsetCharSequence(nameLength, term.text(), transform);

            try {
                // start with a term using the lower case character for the first
                // character of the value.
                if (term.text().length() > nameLength) {
                    // start with initial lower case
                    StringBuffer lowerLimit = new StringBuffer(propName);
                    String termStr = termText.toString();
                    String upperTermStr = termStr.toUpperCase();
                    String lowerTermStr = termStr.toLowerCase();
View Full Code Here

                while (it.hasNext()) {
                    TermEnum terms = (TermEnum) it.next();
                    do {
                        Term t = terms.term();
                        if (t != null) {
                            currentTerm.setBase(t.text());
                            int compare = currentTerm.compareTo(termText);
                            if (compare == 0) {
                                orderedTerms.put(t, new Integer(terms.docFreq()));
                            } else if (compare < 0) {
                                // try next one
View Full Code Here

               {
                  num = idx.removeDocument(idTerm);
                  if (num > 0)
                  {
                     if (log.isDebugEnabled())
                        log.debug(idTerm.text() + " has been found in the persisted index " + i);
                     return;
                  }
               }
            }
         }
View Full Code Here

               }
            }
         }
         else if (log.isDebugEnabled())
         {
            log.debug(idTerm.text() + " has been found in the volatile index");
         }
      }

      /**
       * @inheritDoc
 
View Full Code Here

         else
         {
            int idx = t.field().indexOf(FieldNames.FULLTEXT_PREFIX);
            if (idx != -1)
            {
               relevantTerms.add(new Term(FieldNames.FULLTEXT, t.text()));
            }
         }
      }
      return relevantTerms;
   }
View Full Code Here

              Query newquery = BooleanQueryRewriter.replaceTerm(rwQuery, term, suggestedTerm);

              HashMap<String, Object> resultOfNewQuery = getResultsForQuery(newquery, searcher, sorting, userPermissions);
              if (resultOfNewQuery != null) {
                resultOfNewQuery.put(RESULT_SUGGESTEDTERM_KEY, suggestedTerm.text());
                resultOfNewQuery.put(RESULT_ORIGTERM_KEY, term.text());
                Integer resultCount = (Integer) resultOfNewQuery.get(RESULT_BESTQUERYHITS_KEY);
                if (resultCount > 0) {
                  suggestionsResults.put(resultCount, resultOfNewQuery);
                }
              }
View Full Code Here

        buffer.append(")");
      } else if (subQuery instanceof TermQuery) {
        final Term term = ((TermQuery) subQuery).getTerm();
        buffer.append(term.field());
        buffer.append(":\"");
        buffer.append(term.text());
        buffer.append("\"");
      } else {
        buffer.append(" ");
        buffer.append(c.getQuery().toString());
      }
View Full Code Here

                TermDocs docs = reader.termDocs();
                try {
                    do {
                        Term term = enumerator.term();
                        if (term != null && term.field() == testField) {
                            if (!checkLower || term.text().compareTo(lowerTerm.text()) > 0) {
                                checkLower = false;
                                if (upperTerm != null) {
                                    int compare = upperTerm.text().compareTo(term.text());
                                    // if beyond the upper term, or is exclusive and
                                    // this is equal to the upper term, break out
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.