Package org.apache.lucene.document

Examples of org.apache.lucene.document.Field.tokenStreamValue()


         
          for (Iterator it = fields.iterator(); it.hasNext(); ) {
           
            Field field = (Field) it.next();

            if (field.isIndexed() && field.tokenStreamValue() != null) {
             
              TokenStream tokenStream = field.tokenStreamValue();
             
              Collection<AnnotationFS> matchingTextAnnotations = new LinkedList<AnnotationFS>();
View Full Code Here


           
            Field field = (Field) it.next();

            if (field.isIndexed() && field.tokenStreamValue() != null) {
             
              TokenStream tokenStream = field.tokenStreamValue();
             
              Collection<AnnotationFS> matchingTextAnnotations = new LinkedList<AnnotationFS>();

              QueryScorer scorer = new QueryScorer(query.query(), field.name());
              scorer.startFragment(new TextFragment(
View Full Code Here

    Analyzer analyzer = getRunData().getAnalyzer();
    int tokenCount = 0;
    for(int i=0;i<numField;i++) {
      final Field field = (Field) fields.get(i);
      final TokenStream stream;
      final TokenStream streamValue = field.tokenStreamValue();

      if (streamValue != null)
        stream = streamValue;
      else {
        // the field does not have a TokenStream,
View Full Code Here

        if (field.isTokenized()) {
          int termCounter = 0;
          final TokenStream tokenStream;
          // todo readerValue(), binaryValue()
          if (field.tokenStreamValue() != null) {
            tokenStream = field.tokenStreamValue();
          } else {
            tokenStream = analyzer.tokenStream(field.name(), new StringReader(field.stringValue()));
          }
View Full Code Here

        if (field.isTokenized()) {
          int termCounter = 0;
          final TokenStream tokenStream;
          // todo readerValue(), binaryValue()
          if (field.tokenStreamValue() != null) {
            tokenStream = field.tokenStreamValue();
          } else {
            tokenStream = analyzer.tokenStream(field.name(), new StringReader(field.stringValue()));
          }

          final Token reusableToken = new Token();
View Full Code Here

    Analyzer analyzer = getRunData().getAnalyzer();
    int tokenCount = 0;
    for(int i=0;i<numField;i++) {
      final Field field = (Field) fields.get(i);
      final TokenStream stream;
      final TokenStream streamValue = field.tokenStreamValue();

      if (streamValue != null)
        stream = streamValue;
      else {
        // the field does not have a TokenStream,
View Full Code Here

    Collection<Field> fields = fieldBuilder.createFields(tokenStreams, fieldDescription);
    verify(filterBuilder);
    Iterator<Field> fieldIterator = fields.iterator();
    Field field1 = fieldIterator.next();
    assertEquals("field1", field1.name());
    assertEquals(tokenStream, field1.tokenStreamValue());

  }
 
  @Test
  public void testCreateFieldMerged() throws Exception{
View Full Code Here

    verify(filterBuilder);

    Iterator<Field> fieldIterator = fields.iterator();
    Field field1 = fieldIterator.next();
    assertEquals("field1", field1.name());
    assertEquals(tokenStream, field1.tokenStreamValue());
  }

  @Test
  public void testCreateFieldNoIndex() throws Exception{
   
View Full Code Here

          serializer.addFieldWithSerializableReaderData( new LuceneFieldContext( safeField ) );
        }
        else if ( safeField.readerValue() != null )  {
          throw log.conversionFromReaderToStringNotYetImplemented();
        }
        else if ( safeField.tokenStreamValue() != null )  {
          serializer.addFieldWithTokenStreamData( new LuceneFieldContext( safeField ) );
        }
        else {
          throw log.unknownFieldType( safeField.getClass() );
        }
View Full Code Here

          serializer.addFieldWithSerializableReaderData( new LuceneFieldContext( safeField ) );
        }
        else if ( safeField.readerValue() != null ) {
          throw log.conversionFromReaderToStringNotYetImplemented();
        }
        else if ( safeField.tokenStreamValue() != null ) {
          serializer.addFieldWithTokenStreamData( new LuceneFieldContext( safeField ) );
        }
        else {
          throw log.unknownFieldType( safeField.getClass() );
        }
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.