[infinispan-dev] Query module new API and configurations
Emmanuel Bernard
emmanuel at hibernate.org
Tue Aug 25 06:09:28 EDT 2009
On 25 août 09, at 11:33, Manik Surtani wrote:
>>
>> CacheQuery cq = new QueryFactory(cache).getQuery("fieldName",
>> "stuffToSearchFor");
>
> Looks good. But I think we should also support Lucene queries
> directly, as they provide a richer set of searchable terms and
> constraints. Or perhaps impls like BooleanQuery to combine queries.
>
> E.g.:
>
> Query luceneQuery = createComplexLuceneQuery();
> CacheQuery cq = new QueryFactory(cache).getQuery(luceneQuery);
>
> See:
>
> http://lucene.apache.org/java/2_4_1/api/core/org/apache/lucene/search/Query.html
It's a fine line to add "easy" query object factory methods:
- this single term query is often not enough
- even when it is, are you doing a TermQuery, a FuzzyTermQuery
(which fuzzy factor), a PrefixQuery or even why not a RangeQuery?
where are you going to draw the line? I would rather see some DSL to
build Lucene queries which I would like to work on for HSearch as soon
as free time comes by.
More information about the infinispan-dev
mailing list