【问题标题】:Neo4j automatic index doesn't work first timeNeo4j 自动索引第一次不起作用
【发布时间】:2015-03-11 21:10:01
【问题描述】:

我有以下测试:

  @Test
    public void testAutoIndexingAndFuzzySearch() {
        GraphDatabaseService graphDb = template.getGraphDatabaseService();

        Index<Node> autoIndex = graphDb.index().forNodes("node_auto_index");
        graphDb.index().setConfiguration(autoIndex, "type", "fulltext");
        graphDb.index().setConfiguration(autoIndex, "to_lower_case", "true");
        graphDb.index().setConfiguration(autoIndex, "analyzer", StandardAnalyzerV36.class.getName());

        sampleDataGenerator.generateSampleDataJava();

        List<Product> products = // query - "name:aDbma~";

        Assert.assertFalse(products.isEmpty());
    }

每次在新的嵌入式数据库上测试都会失败。自动索引不起作用。测试仅每第二次开始工作。第一次产品是空的..

这种行为的原因可能是什么?

【问题讨论】:

    标签: lucene neo4j full-text-search cypher spring-data-neo4j


    【解决方案1】:

    将配置传递给非常第一次调用forNodes(index,config)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-12
      • 1970-01-01
      • 1970-01-01
      • 2017-09-05
      • 1970-01-01
      • 2012-05-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多