Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Guys,
I've spent quite a bit of time on this now and I feel like I'm hitting my head against a brick wall!!
I have a field in my examine results - 'facilities:5'
Now if I use the following code, I get the correct results:
?q=5 .GroupedOr(new[] { "facilities" }, Request.QueryString["q"].Split(','))
?q=5
.GroupedOr(new[] { "facilities" }, Request.QueryString["q"].Split(','))
Or
?q=5&q=4 .GroupedOr(new[] { "facilities" }, Request.QueryString["q"].Split(','))
?q=5&q=4
However, if facilities contains an extra int e.g. 'facilities:5,4' and run the following code:
I get no results, what am I doing wrong?
I must be misunderstanding the use of the .GroupedOr(), I've looked through allot of documentation and tried allot of different methods with no success.
Thanks
Darren
Darren,
Can you post back the generated lucene query? You can do it by doing criteria.String()
Regards
Ismail
Hi Ismail,
{ SearchIndexType: content, LuceneQuery: +(+nodeTypeAlias:umbdirectoryitem +(facilities:4 facilities:5)) +__IndexType:content }
Not sure if this is the right information you require?
That is the information i require and the query looks ok to me. Can you open the index in luke and try the query in there:
+(+nodeTypeAlias:umbdirectoryitem +(facilities:4 facilities:5)) +__IndexType:content
Really appreciate your help with this.
I've downloaded luke, nice tool.
It seems my result will only come up if I search 5,4 for 'facilities:5,4',
If I try to search for 4 or 5 on its own or 4,5, I get no results.
Is there a way of searching against the individual field values in the search criteria?
Thanks again
darren,
Ok so i am assuming that a facility can have more than one value and the value is stored as csv? If so then you need to use gatheringnode data event and store it as spaced separated then it will be tokensised in the index see https://thecogworks.com/blog/posts/examiness-hints-and-tips-from-the-trenches-part-2-umbraco-examine/ and https://our.umbraco.org/forum/developers/extending-umbraco/11659-Examine-quering-path
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Examine - issue searching field with multiple integers
Hi Guys,
I've spent quite a bit of time on this now and I feel like I'm hitting my head against a brick wall!!
I have a field in my examine results - 'facilities:5'
Now if I use the following code, I get the correct results:
Or
However, if facilities contains an extra int e.g. 'facilities:5,4' and run the following code:
I get no results, what am I doing wrong?
I must be misunderstanding the use of the .GroupedOr(), I've looked through allot of documentation and tried allot of different methods with no success.
Thanks
Darren
Darren,
Can you post back the generated lucene query? You can do it by doing criteria.String()
Regards
Ismail
Hi Ismail,
Not sure if this is the right information you require?
Thanks
Darren
Darren,
That is the information i require and the query looks ok to me. Can you open the index in luke and try the query in there:
Regards
Ismail
Hi Ismail,
Really appreciate your help with this.
I've downloaded luke, nice tool.
It seems my result will only come up if I search 5,4 for 'facilities:5,4',
If I try to search for 4 or 5 on its own or 4,5, I get no results.
Is there a way of searching against the individual field values in the search criteria?
Thanks again
Darren
darren,
Ok so i am assuming that a facility can have more than one value and the value is stored as csv? If so then you need to use gatheringnode data event and store it as spaced separated then it will be tokensised in the index see https://thecogworks.com/blog/posts/examiness-hints-and-tips-from-the-trenches-part-2-umbraco-examine/ and https://our.umbraco.org/forum/developers/extending-umbraco/11659-Examine-quering-path
is working on a reply...