Examples of KeywordAnalyzer


Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

  }

  private static void createShard(Configuration configuration, int i, Path path, int totalShardCount)
      throws IOException {
    HdfsDirectory hdfsDirectory = new HdfsDirectory(configuration, path);
    IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_43, new KeywordAnalyzer());
    TieredMergePolicy mergePolicy = (TieredMergePolicy) conf.getMergePolicy();
    mergePolicy.setUseCompoundFile(false);
    IndexWriter indexWriter = new IndexWriter(hdfsDirectory, conf);

    Partitioner<IntWritable, IntWritable> partitioner = new HashPartitioner<IntWritable, IntWritable>();
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

    }
  }

  private IndexReader getReader() throws CorruptIndexException, LockObtainFailedException, IOException {
    RAMDirectory directory = new RAMDirectory();
    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
    IndexWriter writer = new IndexWriter(directory, conf);
    Document doc = new Document();
    doc.add(new Field("a", "b", Store.YES, Index.NOT_ANALYZED_NO_NORMS));
    doc.add(new Field("family", "f1", Store.YES, Index.NOT_ANALYZED_NO_NORMS));
   
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

    return IndexReader.open(directory);
  }
 
  private IndexReader getReaderWithDocsHavingFamily() throws CorruptIndexException, LockObtainFailedException, IOException {
      RAMDirectory directory = new RAMDirectory();
      IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
      IndexWriter writer = new IndexWriter(directory, conf);
      Document doc = new Document();
      doc.add(new Field("a", "b", Store.YES, Index.NOT_ANALYZED_NO_NORMS));
      doc.add(new Field("family", "f2", Store.YES, Index.NOT_ANALYZED_NO_NORMS));
     
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

    Path[] paths = getPaths();
    int numberOfShardsToMergePerPass = paths.length / newShardCount;
    for (int i = 0; i < newShardCount; i++) {
      System.out.println("Base Index [" + paths[i] + "]");
      IndexWriterConfig lconf = new IndexWriterConfig(Version.LUCENE_42, new KeywordAnalyzer());
      HdfsDirectory dir = new HdfsDirectory(getConf(), paths[i]);
      IndexWriter indexWriter = new IndexWriter(dir, lconf);
      Directory[] dirs = new Directory[numberOfShardsToMergePerPass - 1];
      Path[] pathsToDelete = new Path[numberOfShardsToMergePerPass - 1];
      for (int p = 1; p < numberOfShardsToMergePerPass; p++) {
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

    assertEquals("FileTypes did not match Expected [" + expected + "] Actual [" + actual + "]", expected.fieldType()
        .toString(), actual.fieldType().toString());
  }

  protected BaseFieldManager newFieldManager(boolean create) throws IOException {
    return new BaseFieldManager(_fieldLessField, new KeywordAnalyzer(), new Configuration()) {
      @Override
      protected boolean tryToStore(FieldTypeDefinition fieldTypeDefinition, String fieldName) {
        return true;
      }
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

  @Override
  public Analyzer getAnalyzerForIndex(String fieldName) {
    // This happens because the doubles are tokenized but the analyzer is
    // fetched from the Field, but the offset is still fetched from the base
    // analyzer. This seems like a bug.
    return new KeywordAnalyzer();
  }
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

    Path path = new Path("./target/tmp/HdfsFieldManagerTest/meta");
    FileSystem fileSystem = path.getFileSystem(config);
    if (create) {
      fileSystem.delete(path, true);
    }
    return new HdfsFieldManager(_fieldLessField, new KeywordAnalyzer(), path, config);
  }
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

    }
  }

  private IndexReader createIndex() throws CorruptIndexException, LockObtainFailedException, IOException {
    RAMDirectory directory = new RAMDirectory();
    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
    IndexWriter writer = new IndexWriter(directory, conf);
    FieldType fieldType = new FieldType();
    fieldType.setStored(true);
    fieldType.setIndexed(true);
    fieldType.setOmitNorms(true);
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

  }

  @Test
  public void testSymlinkWithIndexes() throws IOException {
    HdfsDirectory dir1 = new HdfsDirectory(_configuration, new Path(_base, "dir1"));
    IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_43, new KeywordAnalyzer());
    IndexWriter writer1 = new IndexWriter(dir1, conf.clone());
    writer1.addDocument(getDoc());
    writer1.close();

    HdfsDirectory dir2 = new HdfsDirectory(_configuration, new Path(_base, "dir2"));
View Full Code Here

Examples of org.apache.lucene.analysis.core.KeywordAnalyzer

    }
  }

  private IndexReader getReader() throws CorruptIndexException, LockObtainFailedException, IOException {
    RAMDirectory directory = new RAMDirectory();
    IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
    IndexWriter writer = new IndexWriter(directory, conf);
    Document doc = new Document();
    doc.add(new StringField("a", "b", Store.YES));
    doc.add(new StringField("family", "f1", Store.YES));
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.