I am making a dynamic query however i cannot see how to add range values dynamically, with the fluent api you do
var criteria = _searcher.CreateSearchCriteria(IndexTypes.Content);
criteria.Range(..)
However I am doing
var criteria = _searcher.CreateSearchCriteria(IndexTypes.Content);
IBooleanOperation query = criteria.NodeTypeAlias("Product");
foreach (string key in Request.QueryString.Keys)
{
if (Request.QueryString[key]!=string.Empty){
//field is in lucene as eg __theme
if (RangeFields.Contains(key) && !skipFlag)
{
//stuck here do i add range
}
else if(skipFlag)
{
skipFlag = false;
}
else{
query = query.And().Field("__" + key, Request.QueryString[key]);
}
}
}
Examine dynamic range query
I am making a dynamic query however i cannot see how to add range values dynamically, with the fluent api you do
However I am doing
var criteria = _searcher.CreateSearchCriteria(IndexTypes.Content); IBooleanOperation query = criteria.NodeTypeAlias("Product"); foreach (string key in Request.QueryString.Keys) { if (Request.QueryString[key]!=string.Empty){ //field is in lucene as eg __theme if (RangeFields.Contains(key) && !skipFlag) { //stuck here do i add range } else if(skipFlag) { skipFlag = false; } else{ query = query.And().Field("__" + key, Request.QueryString[key]); } } }
Regards
Ismail
So i tried the following
Now how do i add those to my query object?
Ismail
Ok sorted:
Now to test!!!
Ismail
is working on a reply...