Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I would like to accomplish the following and simply would like to know if it's possible through Umbraco 7.
(1) Attach a custom property editor to each content node that holds a custom integer ranging from 1 to 100.
(2) Through examine search results, sort results in ascending order based on that integer value.
is this possible?
Yes, have a look at the examine documentation for sorting here:
Essentially examine will sort by string by default, eg return "10" before "2" for a numerical field, but if you tell it via the examine configuration that the index item is of type INT, and enablesorting on it, (same for datetime too) then you should be able to achieve the result you are after.
<IndexSet SetName="documentationIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/documentation/">
<add Name="likes" Type="INT" EnableSorting="true"/>
var sc = ExamineManager.Instance.CreateSearchCriteria();
var query = sc.Field("doc", "hats")
Thank you! This works for me.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted