Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Using EpiFind nuget package to index, how do I set the ID

Vote:
 

I have an object like below. I have defined the _id field but I do NOT get the value I passed set as the ID.

How do I force it to use MY id that I pass it?

    public  class MarketReportItem : ISearchContent
    {

	    public string _index { get; set; }
        public string _type { get; set; }
        public string DocumentGuid { get; set; }
        public string FileName { get; set; }
        public string _Type { get; set; }
        public string _id { get; set; }

#200649
Jan 18, 2019 19:42
Vote:
 

Please post on forum related to EpiServer Find https://world.episerver.com/forum/developer-forum/EPiServer-Search/ 

#200661
Edited, Jan 21, 2019 2:12
Vote:
 

Moved to Episerver Find Forum

#200662
Jan 21, 2019 4:06
Vote:
 

Not my question Binh - I just helped by moving to the right forum.

Thanks the for suggested link though - hopefully pk1023 finds it useful!

#200665
Jan 21, 2019 5:15
Vote:
 

Oh, I confused a bit :)

#200667
Jan 21, 2019 7:21
Vote:
 

The easiest way is to use attribute 

[Id]


But you can also do it in the setup of Find, saying that for this class, this property is the id.

Read more here:
https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/Indexing/

#200668
Jan 21, 2019 7:32
* 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.