API Questions on Kentico API.
Version 6.x > API > Custom Index View modes: 
User avatar
Member
Member
dz-v - 2/12/2014 8:07:06 AM
   
Custom Index
I have installed Kentico CMS 6.0 and I have created custom index using this tutorial -> http://devnet.kentico.com/docs/6_0/devguide/index.html?smart_search_defining_custom_index_content.htm.
In my Custom Index I'm querying through a sql table and I'm adding a documents
sql = "SELECT Name, Id, Description From TableXXX";
result = SqlHelperClass.ExecuteQuery(sql, null, QueryTypeEnum.SQLQuery);
foreach (DataRow dr in result.Tables[0].Rows)
{
var name = dr["Name"].ToString();
var description = dr["Description"].ToString();
var id = dr["Id"].ToString();
var doc = SearchHelper.CreateDocument(SearchHelper.CUSTOM_SEARCH_INDEX, Guid.NewGuid().ToString(), SearchHelper.INVARIANT_FIELD_VALUE, DateTime.Now, SearchHelper.INVARIANT_FIELD_VALUE);
SearchHelper.AddField(doc, SearchHelper.CUSTOM_URL, id, true, false);

SearchHelper.AddField(doc, SearchHelper.CONTENT_FIELD, name, true, true);
}
SearchHelper.AddField(doc, SearchHelper.CONTENT_FIELD, description, true, true);
SearchHelper.AddField(doc, SearchHelper.CUSTOM_TITLE, "test", true, false);
SearchHelper.AddField(doc, SearchHelper.CUSTOM_CONTENT, id, true, false);
SearchHelper.AddField(doc, SearchHelper.CUSTOM_DATE, DateTime.Now, true, false);
iw.AddDocument(doc);
}

I have set analyzer type to 'subset', currently id doesn't find all elements. For example I have:
a1, a1f, a1fyy, a1f-xxx

when I type to Smart Search 'a1' the results are found. If I type 'a1f' only one element is found. Also when I use '-' (minus sign) in search form the values are always ignored.

How can I fix the issue so when I type 'a1f' I got 'a1f, a1fyy, a1f-xxx'. Also I'd like to type 'a1f-xxx' to get 'a1f-xxx' (now I can't as all search inputs with '-' are ignored)

User avatar
Kentico Support
Kentico Support
kentico_romank - 2/22/2014 4:04:26 AM
   
RE:Custom Index
Hi,

Could you please apply the hotfix number 44, there was a bug when the "Subset" index analyzer didn't work correctly for words containing special characters, including '-' (minus sign).

I believe this will solve the issue.

Best Regards,
Roman Konicek