Media search and hyphens

Vote:
 

I have a question regarding media search from a user perspective. The majority of image files we are importing follow a certain, established naming convention that includes a hyphen (e.g. tr17-0030) and searching for that exact name returns every file that includes tr17 with no exact match and it seems to ignore everything after the hyphen. I wanted to confirm if that is the case and if there is a way to adjust the search to include hyphens so the results would return tr17-0030 at the top of the list.

#218864
Mar 23, 2020 17:06
Vote:
 

Hey,

Hyphen is the reserved character so it will be excluded from the result

https://world.episerver.com/documentation/developer-guides/search-navigation/NET-Client-API/searching/reserved-characters/

For any search string, the following characters are reserved:

+ - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ /

If any of those characters appears in a query, it is escaped to prevent errors. For example, the string John+Doe is escaped to John\\+Doe.

I think you can write custom logic to replace the "hyphen" with space or any other character and then your search will work properly.

#218898
Mar 24, 2020 7:41
Vote:
 

Thank you for the response, that narrows my problem down a bit. Now, how would I go about returning results for this exact file name: tr17-0030. It appears to me that not only the hyphen but also the numbers (0300) are causing problems? Any ideas?

#218907
Mar 24, 2020 17:17
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.