Versions Compared

Key

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

...

Please note that OData protocol is not supported by CXF Search API, only the $filter query is supported (only logical operators for now) for querying the application data with CXF Search API. Users should work directly with Apache Olingo to get the OData protocol supported as part of the application flow.

Some of the following examples on this page may often refer to FIQL due to the fact FIQL has been supported for a long time, but the same examples will work with OData $filter expressions. For example, replace the "_s=name==CXF" query with "$filter=name eq CXF".

Please use a "search.query.parameter.name" contextual property to indicate to the runtime that a $filter query option need to be checked for the query expression and a "search.parser" property to point to the instance of org.apache.cxf.jaxrs.ext.search.odata.ODataParser, as shown in this test, see the startServers function.

Also note that Apache Olingo offers its own visitor model which can be used to work with JPA2, etc.

When to use advanced queries.

...

Dependencies and Configuration

The following dependency is required starting from CXF 2.6.0:dependency is required starting from CXF 2.6.0:

Code Block
xml
xml
   <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-extension-search</artifactId>
      <version>2.6.0</version>
   </dependency>

   <!-- If working with OData -->
   <!--
    
Code Block
xmlxml
   <dependency>
            <groupId>org.apache.cxf<olingo</groupId>
            <artifactId>cxf<artifactId>olingo-rtodata2-rscore-extension-search<incubating</artifactId>
           <version>2 <version>1.61.0</version> 
        </dependency>
   -->
 

Additionally, in starting from CXF 2.6.0, SearchContextProvider needs to be registered as jaxrs:provider.

...