LuceneFulltextQueryIndexService (Neo4j Apoc 1.1 API)
Keywords: org.neo4j.index.lucene.LuceneFulltextQueryIndexService class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.neo4j.index.lucene
Class LuceneFulltextQueryIndexService

    java.lang.Object
      org.neo4j.index.impl.GenericIndexService
          org.neo4j.index.lucene.LuceneIndexService
              org.neo4j.index.lucene.LuceneFulltextIndexService
                  org.neo4j.index.lucene.LuceneFulltextQueryIndexService

All Implemented Interfaces:
  IndexService

    public class LuceneFulltextQueryIndexService

extends LuceneFulltextIndexService

A `LuceneFulltextIndexService` which treats the value in `getNodes(String, Object)` as a Lucene query, given in the Lucene query syntax. See more information at http://wiki.neo4j.org/content/Indexing_with_IndexService#A_great_subclass_to_LuceneFulltextIndexService

Field Summary

Fields inherited from class org.neo4j.index.lucene.LuceneFulltextIndexService
`DOC_INDEX_SOURCE_KEY, FULLTEXT_DIR_NAME_POSTFIX`

Fields inherited from class org.neo4j.index.lucene.LuceneIndexService
`DEFAULT_LAZY_SEARCH_RESULT_THRESHOLD, DIR_NAME, DOC_ID_KEY, DOC_INDEX_KEY`

Constructor Summary
`LuceneFulltextQueryIndexService(GraphDatabaseService graphDb)`

Method Summary
`protected org.apache.lucene.search.Query` | `formQuery(String key, Object value, Object matching)`
`org.apache.lucene.queryParser.QueryParser.Operator` | `getDefaultQueryOperator(String key, Object value)` Returns the default operator (AND or OR) used when parsing the query.
`IndexHits<Node>` | `getNodes(String key, Object value)` Here the `value` is treated as a lucene query, http://lucene.apache.org/java/2_9_1/queryparsersyntax.html So if you've indexed node (1) with value "Andy Wachowski" and node (2) with "Larry Wachowski" you can expect this behaviour if you query for: "andy" --> (1) "Andy" --> (1) "wachowski" --> (1), (2) "+wachow* +larry" --> (2) "andy AND larry" --> "andy OR larry" --> (1), (2) "larry Wachowski" --> (1), (2) The default AND/OR behaviour can be changed by overriding `getDefaultQueryOperator(String, Object)`.

Methods inherited from class org.neo4j.index.lucene.LuceneFulltextIndexService
`enableCache, getDataSourceClass, getDirName, getNodesExactMatch, getSingleNodeExactMatch, getXaResourceId`

Methods inherited from class org.neo4j.index.lucene.LuceneIndexService
`getEnabledCacheSize, getLazySearchResultThreshold, getNodes, getNodes, getSingleNode, getSingleNode, index, indexThisTx, instantiateIdToNodeIterator, removeIndex, removeIndex, removeIndexThisTx, setLazySearchResultThreshold, shutdown`

Methods inherited from class org.neo4j.index.impl.GenericIndexService
`beginTx, getGraphDb, removeIndex`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LuceneFulltextQueryIndexService

    public LuceneFulltextQueryIndexService(GraphDatabaseService graphDb)

Parameters:
  `graphDb` - the `GraphDatabaseService` to use.

Method Detail

### formQuery

    protected org.apache.lucene.search.Query formQuery(String key,
                                                       Object value,
                                                       Object matching)

  Overrides:
    `formQuery` in class `LuceneFulltextIndexService`
  Parameters:
    `key` - the key
    `value` - the value
    `matching` - an object describing what kind of matching to do. The type this object is is solely up to the implementation.
  Returns:
    the `Query` formed from key/value.

### getDefaultQueryOperator

    public org.apache.lucene.queryParser.QueryParser.Operator getDefaultQueryOperator(String key,
                                                                                      Object value)

  Returns the default operator (AND or OR) used when parsing the query. See more information at http://lucene.apache.org

  Parameters:
    `key` - the index key.
    `value` - the lucene query.
  Returns:
    the default operator (AND or OR ) used when parsing the query.

### getNodes

    public IndexHits<Node> getNodes(String key,
                                    Object value)

  Here the `value` is treated as a lucene query, http://lucene.apache.org/java/2_9_1/queryparsersyntax.html So if you've indexed node (1) with value "Andy Wachowski" and node (2) with "Larry Wachowski" you can expect this behaviour if you query for:
  - "andy" --> (1)
  - "Andy" --> (1)
  - "wachowski" --> (1), (2)
  - "+wachow* +larry" --> (2)
  - "andy AND larry" -->
  - "andy OR larry" --> (1), (2)
  - "larry Wachowski" --> (1), (2)
  The default AND/OR behaviour can be changed by overriding `getDefaultQueryOperator(String, Object)`.

  Specified by:
    `getNodes` in interface `IndexService`
  Overrides:
    `getNodes` in class `LuceneFulltextIndexService`
  Parameters:
    `key` - the key for index
    `value` - the value for index
  Returns:
    nodes that have been indexed with key and value

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 Neo4j. All Rights Reserved.