Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Mapping of FIQL/OData expressions to Lucene (4.0.0-BETA) Query is supported starting from CXF 2.7.1. Please notice that starting from CXF 3.0.2, the Lucene version has been upgraded to 4.9.0 in order to benefit from query builders and other improvements.

org.apache.cxf.jaxrs.ext.search.lucene.LuceneQueryVisitor can be used to support the default (content) field or specific custom field queries.
Queries for specific terms and phrases are supported.

...

In this example, the visitor is requested to create Lucene org.apache.lucene.search.PhraseQuery against the specified contents field ("contents"). The visitor can also accept a contentsFieldMap map property when different phrases may need to be checked against different contents fields.

The current limitation is that no Starting from CXF 3.0.2, the typed Date range queries are supported yet (except for the equality match), for example, "find all the documents issued before a given date", to be supported shortly.by LuceneQueryVisitor. However, this feature should be used together with 'primitiveFieldTypeMap' in order to hint the visitor which fields are temporal and should be treated as such in the filter expressions. For example:

Code Block
java
java
Map< String, Class< ? > > fieldTypes = new LinkedHashMap< String, Class< ? > >();
fieldTypes.put( "modified", Date.class);

SearchCondition<SearchBean> filter = new FiqlParser<SearchBean>(SearchBean.class).parse("modified=gt=2007-09-16");
LuceneQueryVisitor<SearchBean> lucene = new LuceneQueryVisitor<SearchBean>("ct", "contents");
lucene.setPrimitiveFieldTypeMap(fieldTypes);
lucene.visit(filter);

org.apache.lucene.search.Query query = lucene.getQuery();

 

LDAP

Mapping of FIQL/OData expressions to LDAP queries as defined by RFC-4515 is supported starting from CXF 2.7.1 with the help of org.apache.cxf.jaxrs.ext.search.ldap.LdapQueryVisitor. Use this visitor when working with LDAP or OSGI.

...