Find: Indexing for immediate use

Vote:
 

In the Find documentation I found that, for testing purposes, you can do:

client.Index(toIndex, x => x.Refresh = true);


However, when toIndex is a list of objects, I get the following error:

{"Invalid type id. Maximum 200  word characters (letter, number, underscore, dot, comma): System_Collections_Generic_List`1[[DGTNext_Api_Data_DB_Product, DGTNext_Api_Entities, Version=1_0_0_0, Culture=neutral, PublicKeyToken=null]]."}

Iterating causes no error:

foreach (var prod in toIndex) client.Index(prod, x => x.Refresh = true);


It is a short list, 5 small objects. Still, it seems it's over some (quite small) limit for immediate indexing, is that correct?

So, my next question is, if I have to do the iteration, do I need to add the Refresh = true clause for each object, or is it sufficient to do it for the last one? In other words, does the Refresh just mean "process this object" or "process all unprocessed objects"?

Thanks.

#150902
Jul 01, 2016 12:58
Vote:
 

The index will be refreshed every second, so normally you should not have to use refresh at all.
With that said, the current API does not support indexing of lists of objects with the refresh command, so when you are invoking Index with refresh overload, you are invoking Index(object ... ), instead of Index(IEnumerable objects), which is why you are getting the error.

If you really need to refresh the index immediately, I think it should be suffiecient to do it on the last object. 

#150930
Jul 04, 2016 8:39
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.