World is now on Opti ID! Learn more

Cms 12 and Lucene Content search query

Vote:
 

Hi, I'm using the Episerver Search CMS project as a search service in a CMS 12 web. I am struggeling with sorting the search results. They appear very randomly in the result. Does anyone have an idea how to implement sorting in the IQueryExpression? Or if there is a better alternative than IQueryExpression?

 

#337088
Mar 03, 2025 8:02
Vote:
 

The IQueryExpression will give random results if the indexing is ongoing. Have you checked if the indexing had finished and if the lucene index was fully built?

#337091
Mar 03, 2025 15:37
Vote:
 

I think its finished, it seems so in admin mode. It succeeds in seconds. Where can i see if the index is fully built? The files on disk looks correct. I can search for all the content but it doesnt sort on published/changed date.

#337092
Mar 03, 2025 15:51
Vote:
 

Typically the indexing job is the first part of the process, the second is when Lucene is analyzing and organizing the index. This may take a while. And if you run the indexing job to often, ideally you only run it once, the index will never be completely structured by lucene.

#337104
Mar 04, 2025 13:12
Vote:
 

Okay, I see. Thanks for great info. If I delete the index files on disk, will it be better organaized if I then run the indexing job once after that? Guess I've run the job too many times :)

#337105
Mar 04, 2025 14:55
Eric Herlitz - Mar 05, 2025 8:09
Yea I'd go for something like that
Magnus - Mar 05, 2025 8:16
Okay, I'll try that and see if there will be a better sorting in the results. If not, do you have an idea how to implement sorting code-wise?
* 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.