Unable to convert value XYZ to the appropriate data type to perform the search. Reason: Unable apply transfor mation "To date time" to value XYZ

Hi all,

since one of the recent releases (4.6 or 4.7), the search function is not working for me anymore. If I search for “XYZ” in the simple search, it shows “Search query: q PARTIAL XYZ” and finds 0 results. Advanced search for example for tags doesn’t work anymore either.

I enabled debug logging and found this:

mayan.apps.dynamic_search.search_query_types <44> [WARNING] "resolve_for_backend() line 143 Unable to convert value `XYZ` to the appropriate data type to perform the search. Reason: Unable apply transformation `To date time` to value `XYZ`."
mayan.apps.dynamic_search.backends.whoosh.backend <44> [DEBUG] "_do_query_resolve() line 84 results: <Top 0 Results for Or([Wildcard('id', '*XYZ*'), Wildcard('document_type__id', '*XYZ*'), Wildcard('document_type__label', '*xyz*'), Wildcard('label', '*xyz*'), Wildcard('description', '*xyz*'), Wildcard('uuid', '*XYZ*'), Wildcard('files__checksum', '*xyz*'), Wildcard('files__filename', '*xyz*'), Wildcard('files__mimetype', '*xyz*'), Wildcard('cabinets__id', '*XYZ*'), Wildcard('cabinets__label', '*xyz*'), Wildcard('comments__text', '*xyz*'), Wildcard('files__file_pages__content__content', '*xyz*'), Wildcard('workflows__log_entries__comment', '*xyz*'), Wildcard('files__file_metadata_drivers__entries__key', '*xyz*'), Wildcard('files__file_metadata_drivers__entries__value', '*xyz*'), Wildcard('metadata__metadata_type__name', '*xyz*'), Wildcard('metadata__value', '*xyz*'), Wildcard('versions__version_pages__ocr_content__content', '*xyz*'), Wildcard('signature_captures__text', '*xyz*'), Wildcard('signature_captures__user__first_name', '*xyz*'), Wildcard('signature_captures__user__last_name', '*xyz*'), Wildcard('signature_captures__user__username', '*xyz*'), Wildcard('files__source_metadata__key', '*xyz*'), Wildcard('files__source_metadata__value', '*xyz*'), Wildcard('tags__color', '*xyz*'), Wildcard('tags__id', '*XYZ*'), Wildcard('tags__label', '*xyz*')]) runtime=0.009781155997188762>"

Questions:

  1. Is this warning the reason why the search is not returning anything?
  2. If so, what causes this attempt to convert my input strings “To date time”?

Thank you for your help!

In case this helps anybody who observes the same warning: After digging around in the code (NB: I feel like the practice of catching various exceptions and turning them into “end-user-readable” messages is quite harmful for debug logging; oh how I wish I had full tracebacks or possibly even stackprinter-package output) I got the suspicion that putting my search terms in quotation marks might help. It did not help in the basic search but it did help if I used advanced search for text-fields like document content.

So now I got search results again. But to be honest, I am not sure if the quotation marks were the solution to my problem and whether the above mentioned warning was actually the root cause. Because even with the quotation marks, the search results were incomplete. So my suspicion is that I was the victim of the search indexing breaking before it is complete, like many others have reported in this forum (Search reindex doesn't work - #5 by joerg.sichermann, Search not working anymore and others).

Long story short, I went back to Django/DB as search backend (described here: Search Backends with Small Servers - #3 by DocCyblade) for now and have a working search again.