[Solved] Help with Examine RangeQuery for Custom Date Field in Umbraco
u

2lach

over 1 year ago
Hello, I'm working on an Umbraco application for a client (version 13) and am encountering issues while using Examine to perform a RangeQuery on a custom date field. My field, named
searchableDateField
, doesn't seem to be indexed in the same manner as Umbraco’s built-in createDate field, despite my efforts to convert
searchableDateField
to the DateTime format ticks, which I believe is also used for
createDate
. When I execute the following query:
query.And(q => q.RangeQuery(new[] { "searchableDateField" }, startDate, endDate, minInclusive: true, maxInclusive: false));
I receive this error message from Examine:
"An error occurred during the search: Could not perform a range query on the field searchableDateField, its value type is Examine.Lucene.Indexing.FullTextType"
Interestingly, when I replace
searchableDateField
with
createDate
, the query works fine and returns the expected results (the documents with a `createDate`between
DateTime startDate
and
DateTime endDate
query.And(q => q.RangeQuery(new[] { "createDate" }, startDate, endDate, minInclusive: true, maxInclusive: false));
I currently save the value of
searchableDateField
in a label in Umbraco as a DateTime (DateTime format Ticks). I have also tried saving the
searchableDateField
in various DateTime formats (both in dateTime labels and fields) and in the compatible types of labels, such as string, BigInt, etc. i could think of and then casting them as DateTime values. However, my results remains the same as described above. The main difference I can think of is that
createDate
exists on all my DocumentTypes, whereas
searchableDateField
does not always exist on all DocumentTypes. If anyone has experience working with custom date fields in Examine and Umbraco and can offer guidance or suggest a solution (even a creative one, as I really want to solve this), I would be very grateful for any tips or advice. Thanks
Examine not indexing all the content after an index rebuild.
p

pablobarrios

11 months ago
Hello, we are using Umbraco Cloud with Umbraco v13 and the default External examine indexer. We have 8 different node types we are filtering on the search of the site. At some point on our Live site, Examine(the external index) stopped indexing everything and was only returning data from 1 node type. Those nodes are only updated by a Hangfire recurring Jobs. It worth to mention that our staging site, which have the same recurring jobs and almost the same data from the Live site, it is working perfectly fine, the Examine external index is returning all the expected results. Hence, after reading a bit, we decided to push the "red" Rebuild index button. After that, more content was coming up, but not all of them. Only the recently published one, like the ones updated by the Recurring jobs. And a couple of other that were "Save and Published" after the rebuild. The rest of the nodes that were published before the rebuild are not showing up. Does this rings a bell? Is there a way to force an import of the old published content? FWIW, the internal index returns all the expected data. And no errors were found on the logs related with Examine or "ExternalIndex". Als, the rebuild on the Umbraco interface was finished after about 2 minutes but on the logs you can see it took more than 20 minutes https://cdn.discordapp.com/attachments/1296843811300970579/1296843811728916500/Screenshot_2024-10-18_at_11.33.26.png?ex=6713c36a&is=671271ea&hm=0313e1fa3de36a83cdee8d2240c86a6f4311a7e8561b59ed4606a662b909e4af&