That works perfectly and the field is inserted into my index.
However, I can't get my raw query to limit to a specific site properly. I've looked at the way ezsearch does this, and so my query is made from a string;
Example;
Sorry, I wasn't completely clear on what it is that I want to accomplish. My problem is, that I have an umbraco installation with many sites. So basically, I want to limit my search to a specific site on each site.
Therefore, I'm trying to get the query to ONLY return results where some nodeid is in the path (The nodeID of the current page). All the logic around finding the proper nodeid etc. is in place, but the query returns results from the other sites, so I want to limit this. So the correct behaviour of my search should be to only return nodes that are under the current site.
I Could just do a linq-query once the results are retrieved, but the solution would be much cleaner if the query only returned results with the ID in the path..
the searchPath is basically just the same as "Path", with the comma's filtered out. Its a field that I create with a handler that hooks into the OnGatheringNodeData event, so this field is in the index.
Help with raw examine query to limit the results by path
Hi All!
I've created an eventhandler that hooks into the "OnGatheringNodeData" and adds a field to my index, called "searchPath", wich is basically path with replace ", " with " ", (As seen here; https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/71237-examine-for-multiple-sites)
That works perfectly and the field is inserted into my index.
However, I can't get my raw query to limit to a specific site properly. I've looked at the way ezsearch does this, and so my query is made from a string; Example;
But that query still finds stuff located on other sites, e.g; doesn't have "2604" in searchPath field.
I've tried adding a "+" in front of "searchPath" but then I get no results (I tried the query in luke also..)
Any idea what I'm doing wrong here? Cheers, Niels
Have you tried using Path, rather than SearchPath?
Apologies if I've not understood this, but the Path parameter lets you look under a certain node in Umbraco.
Also, I think you may have to include the entire path of the node, for the parameter to work.
E.g. if you want to exclude a node at the root it might be something like: path:-1,2604
-1 being the root
Hi Alex.
Sorry, I wasn't completely clear on what it is that I want to accomplish. My problem is, that I have an umbraco installation with many sites. So basically, I want to limit my search to a specific site on each site.
Therefore, I'm trying to get the query to ONLY return results where some nodeid is in the path (The nodeID of the current page). All the logic around finding the proper nodeid etc. is in place, but the query returns results from the other sites, so I want to limit this. So the correct behaviour of my search should be to only return nodes that are under the current site.
I Could just do a linq-query once the results are retrieved, but the solution would be much cleaner if the query only returned results with the ID in the path..
the searchPath is basically just the same as "Path", with the comma's filtered out. Its a field that I create with a handler that hooks into the OnGatheringNodeData event, so this field is in the index.
Thanx for taking your time to help! :)
/Niels
is working on a reply...