Package com.sematext.searchschemer.index

Examples of com.sematext.searchschemer.index.BasicIndexStructure


import com.sematext.searchschemer.index.elasticsearch.ElasticSearchFieldAttributes;

public class ElasticsearchStructureWriterTest extends TestCase {
  @Test
  public void testWriteNonDynamic() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("cat", new ElasticSearchFieldAttributes("cat", "string", "yes", "analyzed"), false);

    StringWriter writer = new StringWriter();
    ElasticsearchIndexStructureWriter indexWriter = new ElasticsearchIndexStructureWriter();
    indexWriter.write(structure, writer);
View Full Code Here


    writer.close();
  }

  @Test
  public void testWriteMultipleNonDynamic() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("cat", new ElasticSearchFieldAttributes("cat", "string", "yes", "analyzed"), false);
    structure.addField("menu", new ElasticSearchFieldAttributes("menu", "string", "yes", "no"), false);

    StringWriter writer = new StringWriter();
    ElasticsearchIndexStructureWriter indexWriter = new ElasticsearchIndexStructureWriter();
    indexWriter.write(structure, writer);
View Full Code Here

    writer.close();
  }

  @Test
  public void testWriteDynamic() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("*_string", new ElasticSearchFieldAttributes("*_string", "string", "yes", "no"), true);

    StringWriter writer = new StringWriter();
    ElasticsearchIndexStructureWriter indexWriter = new ElasticsearchIndexStructureWriter();
    indexWriter.write(structure, writer);

View Full Code Here

    writer.close();
  }

  @Test
  public void testWriteNonDynamicWithAdditionalAttributes() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    ElasticSearchFieldAttributes field = new ElasticSearchFieldAttributes("cat", "string", "yes", "analyzed");
    field.setOmitNorms(true);
    field.setOmitTermFreqAndPositions(true);
    field.setBoost(2.0f);
    structure.addField("cat", field, false);

    StringWriter writer = new StringWriter();
    ElasticsearchIndexStructureWriter indexWriter = new ElasticsearchIndexStructureWriter();
    indexWriter.write(structure, writer);
View Full Code Here

import com.sematext.searchschemer.index.solr.SolrFieldAttributes;

public class SolrIndexStructureWriterTest extends TestCase {
  @Test
  public void testWriteNonDynamic() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("cat", new SolrFieldAttributes("cat", "string", true, true, false), false);

    StringWriter writer = new StringWriter();
    SolrIndexStructureWriter solrIndexStructurWriter = new SolrIndexStructureWriter();
    solrIndexStructurWriter.write(structure, writer);
View Full Code Here

    writer.close();
  }

  @Test
  public void testWriteDynamic() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("*_int", new SolrFieldAttributes("*_int", "string", false, true, false), true);

    StringWriter writer = new StringWriter();
    SolrIndexStructureWriter solrIndexStructurWriter = new SolrIndexStructureWriter();
    solrIndexStructurWriter.write(structure, writer);

View Full Code Here

    writer.close();
  }

  @Test
  public void testWriteMultiple() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("cat", new SolrFieldAttributes("cat", "string", true, true, false), false);
    structure.addField("menu", new SolrFieldAttributes("menu", "string", false, true, false), false);

    StringWriter writer = new StringWriter();
    SolrIndexStructureWriter solrIndexStructurWriter = new SolrIndexStructureWriter();
    solrIndexStructurWriter.write(structure, writer);
View Full Code Here

    writer.close();
  }

  @Test
  public void testWriteMultivalued() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("cat", new SolrFieldAttributes("cat", "string", true, true, true), false);

    StringWriter writer = new StringWriter();
    SolrIndexStructureWriter solrIndexStructurWriter = new SolrIndexStructureWriter();
    solrIndexStructurWriter.write(structure, writer);
View Full Code Here

    writer.close();
  }
 
  @Test
  public void testWriteNonDynamicWithAdditionalAttributes() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    SolrFieldAttributes field = new SolrFieldAttributes("cat", "string", true, true, false);
    field.setOmitNorms(true);
    field.setOmitTermFreqAndPositions(true);
    field.setBoost(2.0f);
    structure.addField("cat", field, false);

    StringWriter writer = new StringWriter();
    SolrIndexStructureWriter solrIndexStructurWriter = new SolrIndexStructureWriter();
    solrIndexStructurWriter.write(structure, writer);
View Full Code Here

import com.sematext.searchschemer.index.sensidb.SenseiDBFieldAttributes;

public class SenseidbIndexStructureWriterTest extends TestCase {
  @Test
  public void testWriteNonDynamic() throws Exception {
    IndexStructure structure = new BasicIndexStructure();
    structure.addField("cat", new SenseiDBFieldAttributes("cat", "string", "analyzed", "yes"), false);

    StringWriter writer = new StringWriter();
    SenseidbIndexStructureWriter senseiIndexStructureWriter = new SenseidbIndexStructureWriter();
    senseiIndexStructureWriter.write(structure, writer);
View Full Code Here

TOP

Related Classes of com.sematext.searchschemer.index.BasicIndexStructure

Copyright © 2018 www.massapicom. 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.