v8 examine search by 'parentID' doesn't return any results?!
hey out there,
this is a weird one, not sure if it's me or a bug...
in v7 i used to filter by parent id using +parentID:1172 as a lucene search:
however the same query isn't working in v8! i've defo got items in the index e.g.
but when i run the search, no items come back...
although v8 is missing the toggle between a text search and a lucene search the search seems to accept lucene based searches as something like +__NodeTypeAlias:blogpost +postDateYearAndMonth:2019-sep works:
I've been upgrading a site to Umbraco 8 over a year later from the OP and ran into exactly the same issue...
Examine can't seem to find content based on a single parentID (even though it is definitely in the index), a query that did work in Umbraco 7
But when I change it to +(parentID:[1119 TO 1119]) it is able to find the data correctly
I'm new to the formal community (first post!), so I'm not sure whether this has been reported as a bug or fixed (although I am using v8.10.1) - but any explanation why this has changed would be great!
This was working in v7, but not in v8. So following on from the +(parentID:[1119 TO 1119]) query working in the ExternalIndex, I made a range query to replicate it, which worked:
On reflection however, I think the important thing is that the parentID data is treated as an int, not as a string when being added to the query, as this works too:
int selectedID = DataNode.Id;
thisQuery.And().Field("parentID", selectedID);
Interestingly in debug this generates a +(parentID:[1119 TO 1119]) query rather than +parentID:1119, although the only thing that has changed is the datatype of the selectedID
So I suspect there is a bug with the index searcher in the umbraco CMS not treating +parentID:1119 as an int, but instead a string for some reason, but at least its working on my end now!
v8 examine search by 'parentID' doesn't return any results?!
hey out there,
this is a weird one, not sure if it's me or a bug...
in v7 i used to filter by parent id using
+parentID:1172
as a lucene search:however the same query isn't working in v8! i've defo got items in the index e.g.
but when i run the search, no items come back...
although v8 is missing the toggle between a
text search
and alucene search
the search seems to accept lucene based searches as something like+__NodeTypeAlias:blogpost +postDateYearAndMonth:2019-sep
works:am i missing something obvious here?!?!
ok, so this is interesting. i did some debugging of the search code i'd written and looked at the examine query and it's looks a little weird...
this is the code:
which generates a lucene query of:
and i get results back!
however, if i take that lucene query and paste it into luke to test the query i get nothing back...
if i change the query to:
then i get results!
seriously confused...
the knock on of all this is that at some point i want to be able to do a
GroupedOr
query e.g.get me all the blog posts that have the parentId 1234 or 5678 or 9101
but
GroupedOr
only allows strings to be passed to it...I've been upgrading a site to Umbraco 8 over a year later from the OP and ran into exactly the same issue...
Examine can't seem to find content based on a single parentID (even though it is definitely in the index), a query that did work in Umbraco 7
But when I change it to +(parentID:[1119 TO 1119]) it is able to find the data correctly
I'm new to the formal community (first post!), so I'm not sure whether this has been reported as a bug or fixed (although I am using v8.10.1) - but any explanation why this has changed would be great!
So following on from my last post, I've got it working again in the code, and I think I know what was causing my issue...
My previous query was getting the parentID as a string:
This was working in v7, but not in v8. So following on from the +(parentID:[1119 TO 1119]) query working in the ExternalIndex, I made a range query to replicate it, which worked:
On reflection however, I think the important thing is that the parentID data is treated as an int, not as a string when being added to the query, as this works too:
Interestingly in debug this generates a +(parentID:[1119 TO 1119]) query rather than +parentID:1119, although the only thing that has changed is the datatype of the selectedID
So I suspect there is a bug with the index searcher in the umbraco CMS not treating +parentID:1119 as an int, but instead a string for some reason, but at least its working on my end now!
seems the problem is still there I used
but I have some results with multiple parentIds. So I assume it couldn't deal with parentId correctly.
Yes, I'm also facing the same issue.
is working on a reply...