TYPE_NOT_STORED.setIndexed(true); TYPE_NOT_STORED.setTokenized(true); TYPE_NOT_STORED.setStoreTermVectors(true); TYPE_NOT_STORED.freeze(); TYPE_STORED.setIndexed(true); TYPE_STORED.setTokenized(true); TYPE_STORED.setStored(true);
@Override public void preParse(ParseContext context) throws IOException { //copy _source field to a new SIREN_SOURCE field FieldType fieldType = new FieldType(); fieldType.setIndexed(true); IndexableField field = new Field(SIREN_SOURCE, new String(context.source().toBytes(), Charset.forName("UTF-8")), fieldType); context.doc().add(field); }
public void addDocument(final String id, final String json) throws IOException { final Document doc = new Document(); doc.add(new StringField(DEFAULT_ID_FIELD, id, Store.YES)); final FieldType sirenFieldType = new FieldType(); sirenFieldType.setIndexed(true); sirenFieldType.setTokenized(true); sirenFieldType.setOmitNorms(true); sirenFieldType.setStored(false); sirenFieldType.setStoreTermVectors(false); doc.add(new Field(DEFAULT_SIREN_FIELD, json, sirenFieldType)); writer.addDocument(doc); }
public void addDocument(final String id, final String json) throws IOException { final Document doc = new Document(); doc.add(new StringField(DEFAULT_ID_FIELD, id, Store.YES)); final FieldType sirenFieldType = new FieldType(); sirenFieldType.setIndexed(true); sirenFieldType.setTokenized(true); sirenFieldType.setOmitNorms(true); sirenFieldType.setStored(false); sirenFieldType.setStoreTermVectors(false); doc.add(new Field(DEFAULT_SIREN_FIELD, json, sirenFieldType)); writer.addDocument(doc); }
FieldType fieldType = new FieldType(); fieldType.setStored(true); fieldType.setIndexed(true); BytesRef bytes = new BytesRef(NumericUtils.BUF_SIZE_INT); NumericUtils.intToPrefixCoded(value, 0, bytes); doc.add(new Field(field.getName(),bytes.utf8ToString(), fieldType));
final FieldType type = new FieldType(); type.setNumericPrecisionStep(4); type.setStored(true); type.setIndexed(true); type.setNumericType(FieldType.NumericType.LONG); doc.add(new LongField("BirthDate", parseDate("1969/01/31 16:17:18").getTime(), type));
@Override public SirenFieldMapper build(BuilderContext context) { // In case the mapping overrides these fieldType.setIndexed(true); fieldType.setTokenized(true); return new SirenFieldMapper(name, fieldType, indexAnalyzer, searchAnalyzer, true, true, postingsProvider, docValuesProvider, similarity, normsLoading, fieldDataSettings, context.indexSettings()); } }
FieldType _contentFieldType = new FieldType(); _contentFieldType.setIndexed(true); _contentFieldType.setStored(true); _contentFieldType.setTokenized(false);
private Document newGeoDocument(OIdentifiable oIdentifiable, Shape shape) { FieldType ft = new FieldType(); ft.setIndexed(true); ft.setStored(true); Document doc = new Document(); doc.add(OLuceneIndexType.createField(RID, oIdentifiable.getIdentity().toString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); for (IndexableField f : strategy.createIndexableFields(shape)) { doc.add(f); } doc.add(new StoredField(strategy.getFieldName(), ctx.toString(shape))); return doc; } }
public final class StringNoIndexedField extends Field { public static final FieldType TYPE_NOT_INDEXED = new FieldType(); static { TYPE_NOT_INDEXED.setIndexed(false); TYPE_NOT_INDEXED.setStored(true); TYPE_NOT_INDEXED.setTokenized(false); TYPE_NOT_INDEXED.freeze(); } public StringNoIndexedField(String name, String value) { super(name, value, TYPE_NOT_INDEXED); } }
private static Document createLuceneDocumentFromObject(BroadcastDocumentObject objectDoc) throws IOException { Document indexDoc = new Document(); FieldType ftSyn = new FieldType(); ftSyn.setStored(false); ftSyn.setIndexed(true); ftSyn.setOmitNorms(true); ftSyn.freeze(); indexDoc.add(new StringField(DictionarySearcher.F_CATID, objectDoc.getCategory(), Field.Store.YES)); for (String value : objectDoc.getValueSet()) { // F_RAW field is necessary for broadcasting with new validation modes. indexDoc.add(new Field(DictionarySearcher.F_RAW, value, DictionaryUtils.FIELD_TYPE_RAW_VALUE)); indexDoc.add(new StringField(DictionarySearcher.F_SYNTERM, DictionarySearcher.getJointTokens(value), Field.Store.NO)); } return indexDoc; } }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_44, null); if (indexWriter == null) { try { indexWriter = new IndexWriter(FSDirectory.open(luceneDir), config); } catch (IOException e) { throw new ResourceInitializationException(e); } } currentDocumentId = null; currentDocument = null; fieldType = new FieldType(); fieldType.setIndexed(true); fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS); fieldType.setStored(true); fieldType.setOmitNorms(true); fieldType.setTokenized(false); fieldType.freeze(); }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_44, null); if (indexWriter == null) { try { indexWriter = new IndexWriter(FSDirectory.open(luceneDir), config); } catch (IOException e) { throw new ResourceInitializationException(e); } } currentDocumentId = null; currentDocument = null; fieldType = new FieldType(); fieldType.setIndexed(true); fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS); fieldType.setStored(true); fieldType.setOmitNorms(true); fieldType.setTokenized(false); fieldType.freeze(); }
FieldType type = new FieldType(); type.setIndexed(true); type.setIndexOptions(FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS); type.setStored(true); type.setStoreTermVectors(true); type.setTokenized(true); type.setStoreTermVectorOffsets(true); Field field = new Field("content", "This is fragment. Highlters", type); doc.add(field); //this field has term Vector enabled. //without term vector enabled. doc.add(new StringField("ncontent","This is fragment. Highlters", Field.Store.YES));
FieldType fieldType = new FieldType(); fieldType.setStoreTermVectors(true); fieldType.setStoreTermVectorPositions(true); fieldType.setIndexed(true); fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS); fieldType.setStored(true);
Document doc = new Document(); FieldType f = new FieldType(); f.setIndexed(true); f.setStoreTermVectors(true); f.setStoreTermVectorPositions(true); doc.add(new Field("text", "hello", f));
FieldType type = new FieldType(); type.setIndexed(true); type.setIndexOptions(FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS); type.setStored(true); type.setStoreTermVectors(true); type.setTokenized(true); type.setStoreTermVectorOffsets(true);
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); initializeWriter(); initDocument(); fieldType = new FieldType(); fieldType.setIndexed(true); fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS); fieldType.setStored(true); fieldType.setOmitNorms(true); fieldType.setTokenized(false); fieldType.freeze(); activeWriter.incrementAndGet(); }
private static FieldType newFieldType() { final FieldType ft = new FieldType(); ft.setStored(false); ft.setOmitNorms(false); ft.setIndexed(true); ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS); ft.setTokenized(true); return ft; }
private static FieldType newFieldType() { final FieldType ft = new FieldType(); ft.setStored(false); ft.setOmitNorms(false); ft.setIndexed(true); ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS); ft.setTokenized(true); return ft; }