當前位置: 首頁>>代碼示例>>Java>>正文


Java LongField.TYPE_NOT_STORED屬性代碼示例

本文整理匯總了Java中org.apache.lucene.document.LongField.TYPE_NOT_STORED屬性的典型用法代碼示例。如果您正苦於以下問題:Java LongField.TYPE_NOT_STORED屬性的具體用法?Java LongField.TYPE_NOT_STORED怎麽用?Java LongField.TYPE_NOT_STORED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.lucene.document.LongField的用法示例。


在下文中一共展示了LongField.TYPE_NOT_STORED屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configure

@Override
public void configure(String fieldNameForThisInstance, Map<String, String> properties, Configuration configuration) {
  final String dateFormat = properties.get(DATE_FORMAT);
  if (dateFormat == null) {
    throw new RuntimeException("The property [" + DATE_FORMAT + "] can not be null.");
  }
  final String timeUnitStr = properties.get(TIME_UNIT);
  if (timeUnitStr != null) {
    _timeUnit = TimeUnit.valueOf(timeUnitStr.trim().toUpperCase());
  }
  _simpleDateFormat = new ThreadValue<SimpleDateFormat>() {
    @Override
    protected SimpleDateFormat initialValue() {
      return new SimpleDateFormat(dateFormat);
    }
  };
  String precisionStepStr = properties.get(NUMERIC_PRECISION_STEP);
  if (precisionStepStr != null) {
    _precisionStep = Integer.parseInt(precisionStepStr);
    _typeNotStored = new FieldType(LongField.TYPE_NOT_STORED);
    _typeNotStored.setNumericPrecisionStep(_precisionStep);
    _typeNotStored.freeze();
  } else {
    _typeNotStored = LongField.TYPE_NOT_STORED;
  }
}
 
開發者ID:apache,項目名稱:incubator-blur,代碼行數:26,代碼來源:DateFieldTypeDefinition.java

示例2: configure

@Override
public void configure(String fieldNameForThisInstance, Map<String, String> properties, Configuration configuration) {
  String precisionStepStr = properties.get(NUMERIC_PRECISION_STEP);
  if (precisionStepStr != null) {
    _precisionStep = Integer.parseInt(precisionStepStr);
    _typeStored = new FieldType(LongField.TYPE_STORED);
    _typeStored.setNumericPrecisionStep(_precisionStep);
    _typeStored.freeze();
    _typeNotStored = new FieldType(LongField.TYPE_NOT_STORED);
    _typeNotStored.setNumericPrecisionStep(_precisionStep);
    _typeNotStored.freeze();
  } else {
    _typeStored = LongField.TYPE_STORED;
    _typeNotStored = LongField.TYPE_NOT_STORED;
  }
}
 
開發者ID:apache,項目名稱:incubator-blur,代碼行數:16,代碼來源:LongFieldTypeDefinition.java

示例3: longField

@Override
public void longField(FieldInfo fieldInfo, long value) {
  FieldType ft = new FieldType(LongField.TYPE_NOT_STORED);
  ft.setStored(true);
  ft.setIndexed(fieldInfo.isIndexed());
  doc.add(new LongField(fieldInfo.name, value, ft));
}
 
開發者ID:europeana,項目名稱:search,代碼行數:7,代碼來源:SolrIndexSearcher.java

示例4: longField

@Override
public void longField(FieldInfo fieldInfo, long value) {
	FieldType ft = new FieldType(LongField.TYPE_NOT_STORED);
	ft.setStored(true);
	ft.setIndexed(fieldInfo.isIndexed());
	doc.add(new LongField(fieldInfo.name, value, ft));
}
 
開發者ID:netboynb,項目名稱:search-core,代碼行數:7,代碼來源:SolrIndexSearcher.java

示例5: beforeClass

@BeforeClass
public static void beforeClass() throws Exception {
  noDocs = atLeast(4096);
  distance = (1L << 60) / noDocs;
  directory = newDirectory();
  RandomIndexWriter writer = new RandomIndexWriter(random(), directory,
      newIndexWriterConfig(new MockAnalyzer(random()))
      .setMaxBufferedDocs(TestUtil.nextInt(random(), 100, 1000))
      .setMergePolicy(newLogMergePolicy()));

  final FieldType storedLong = new FieldType(LongField.TYPE_NOT_STORED);
  storedLong.setStored(true);
  storedLong.freeze();

  final FieldType storedLong8 = new FieldType(storedLong);
  storedLong8.setNumericPrecisionStep(8);

  final FieldType storedLong4 = new FieldType(storedLong);
  storedLong4.setNumericPrecisionStep(4);

  final FieldType storedLong6 = new FieldType(storedLong);
  storedLong6.setNumericPrecisionStep(6);

  final FieldType storedLong2 = new FieldType(storedLong);
  storedLong2.setNumericPrecisionStep(2);

  final FieldType storedLongNone = new FieldType(storedLong);
  storedLongNone.setNumericPrecisionStep(Integer.MAX_VALUE);

  final FieldType unstoredLong = LongField.TYPE_NOT_STORED;

  final FieldType unstoredLong8 = new FieldType(unstoredLong);
  unstoredLong8.setNumericPrecisionStep(8);

  final FieldType unstoredLong6 = new FieldType(unstoredLong);
  unstoredLong6.setNumericPrecisionStep(6);

  final FieldType unstoredLong4 = new FieldType(unstoredLong);
  unstoredLong4.setNumericPrecisionStep(4);

  final FieldType unstoredLong2 = new FieldType(unstoredLong);
  unstoredLong2.setNumericPrecisionStep(2);

  LongField
    field8 = new LongField("field8", 0L, storedLong8),
    field6 = new LongField("field6", 0L, storedLong6),
    field4 = new LongField("field4", 0L, storedLong4),
    field2 = new LongField("field2", 0L, storedLong2),
    fieldNoTrie = new LongField("field"+Integer.MAX_VALUE, 0L, storedLongNone),
    ascfield8 = new LongField("ascfield8", 0L, unstoredLong8),
    ascfield6 = new LongField("ascfield6", 0L, unstoredLong6),
    ascfield4 = new LongField("ascfield4", 0L, unstoredLong4),
    ascfield2 = new LongField("ascfield2", 0L, unstoredLong2);

  Document doc = new Document();
  // add fields, that have a distance to test general functionality
  doc.add(field8); doc.add(field6); doc.add(field4); doc.add(field2); doc.add(fieldNoTrie);
  // add ascending fields with a distance of 1, beginning at -noDocs/2 to test the correct splitting of range and inclusive/exclusive
  doc.add(ascfield8); doc.add(ascfield6); doc.add(ascfield4); doc.add(ascfield2);
  
  // Add a series of noDocs docs with increasing long values, by updating the fields
  for (int l=0; l<noDocs; l++) {
    long val=distance*l+startOffset;
    field8.setLongValue(val);
    field6.setLongValue(val);
    field4.setLongValue(val);
    field2.setLongValue(val);
    fieldNoTrie.setLongValue(val);

    val=l-(noDocs/2);
    ascfield8.setLongValue(val);
    ascfield6.setLongValue(val);
    ascfield4.setLongValue(val);
    ascfield2.setLongValue(val);
    writer.addDocument(doc);
  }
  reader = writer.getReader();
  searcher=newSearcher(reader);
  writer.close();
}
 
開發者ID:europeana,項目名稱:search,代碼行數:80,代碼來源:TestNumericRangeQuery64.java

示例6: beforeClass

@BeforeClass
public static void beforeClass() throws Exception {
  noDocs = atLeast(4096);
  distance = (1L << 60) / noDocs;
  directory = newDirectory();
  RandomIndexWriter writer = new RandomIndexWriter(random(), directory,
      newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()))
      .setMaxBufferedDocs(_TestUtil.nextInt(random(), 100, 1000))
      .setMergePolicy(newLogMergePolicy()));

  final FieldType storedLong = new FieldType(LongField.TYPE_NOT_STORED);
  storedLong.setStored(true);
  storedLong.freeze();

  final FieldType storedLong8 = new FieldType(storedLong);
  storedLong8.setNumericPrecisionStep(8);

  final FieldType storedLong4 = new FieldType(storedLong);
  storedLong4.setNumericPrecisionStep(4);

  final FieldType storedLong6 = new FieldType(storedLong);
  storedLong6.setNumericPrecisionStep(6);

  final FieldType storedLong2 = new FieldType(storedLong);
  storedLong2.setNumericPrecisionStep(2);

  final FieldType storedLongNone = new FieldType(storedLong);
  storedLongNone.setNumericPrecisionStep(Integer.MAX_VALUE);

  final FieldType unstoredLong = LongField.TYPE_NOT_STORED;

  final FieldType unstoredLong8 = new FieldType(unstoredLong);
  unstoredLong8.setNumericPrecisionStep(8);

  final FieldType unstoredLong6 = new FieldType(unstoredLong);
  unstoredLong6.setNumericPrecisionStep(6);

  final FieldType unstoredLong4 = new FieldType(unstoredLong);
  unstoredLong4.setNumericPrecisionStep(4);

  final FieldType unstoredLong2 = new FieldType(unstoredLong);
  unstoredLong2.setNumericPrecisionStep(2);

  LongField
    field8 = new LongField("field8", 0L, storedLong8),
    field6 = new LongField("field6", 0L, storedLong6),
    field4 = new LongField("field4", 0L, storedLong4),
    field2 = new LongField("field2", 0L, storedLong2),
    fieldNoTrie = new LongField("field"+Integer.MAX_VALUE, 0L, storedLongNone),
    ascfield8 = new LongField("ascfield8", 0L, unstoredLong8),
    ascfield6 = new LongField("ascfield6", 0L, unstoredLong6),
    ascfield4 = new LongField("ascfield4", 0L, unstoredLong4),
    ascfield2 = new LongField("ascfield2", 0L, unstoredLong2);

  Document doc = new Document();
  // add fields, that have a distance to test general functionality
  doc.add(field8); doc.add(field6); doc.add(field4); doc.add(field2); doc.add(fieldNoTrie);
  // add ascending fields with a distance of 1, beginning at -noDocs/2 to test the correct splitting of range and inclusive/exclusive
  doc.add(ascfield8); doc.add(ascfield6); doc.add(ascfield4); doc.add(ascfield2);
  
  // Add a series of noDocs docs with increasing long values, by updating the fields
  for (int l=0; l<noDocs; l++) {
    long val=distance*l+startOffset;
    field8.setLongValue(val);
    field6.setLongValue(val);
    field4.setLongValue(val);
    field2.setLongValue(val);
    fieldNoTrie.setLongValue(val);

    val=l-(noDocs/2);
    ascfield8.setLongValue(val);
    ascfield6.setLongValue(val);
    ascfield4.setLongValue(val);
    ascfield2.setLongValue(val);
    writer.addDocument(doc);
  }
  reader = writer.getReader();
  searcher=newSearcher(reader);
  writer.close();
}
 
開發者ID:pkarmstr,項目名稱:NYBC,代碼行數:80,代碼來源:TestNumericRangeQuery64.java


注:本文中的org.apache.lucene.document.LongField.TYPE_NOT_STORED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。