Hi Experts:
I am modifying https://github.com/apache/lucy/blob/master/c/sample/search.c
to handle proximity query.
The default QParser_Parse is poweful to enough to handle all BOOLEAN
queries.
But in order to support proximity queries, I have modified the code by
adding the belowcode block.
{
Vector *terms = Vec_new(0);
Vec_Push(terms, (Obj*)query_str);
String *field_name = Str_newf("content");
ProximityQuery *pquery = ProximityQuery_new(field_name, terms, 100);
DECREF(terms);
}
//Hits *hits = IxSearcher_Hits(searcher, (Obj*)query, 0, 10, NULL);
Hits *hits = IxSearcher_Hits(searcher, (Obj*)pquery, 0, 10, NULL);
Unfortunately my hits are NULL. The query string I am passing is "animals
partial", which is there in the documents I have indexed within the 100
words distance mentioned in the ProximityQuery_new () above.
I stumbled upon this perl thread:
http://lucene.472066.n3.nabble.com/lucy-user-Unable-to-retrieve-records-using-Proximity-query-td3990375.html
The above perl thread says that there is no analyzer for ProximityQuery.
Can I know what is the equivalent translation I need to apply for my C code
so as to enable ProximtyQuery and get it working?
Thanks
-Kasi