Thank you for the quick answer!
I do not use the tutorial index, I rather use my own. These are the steps I take in the index Rebuild event:
I create a MediaFileInfo object with the information returned from the database and extract the content:
MediaFileInfo mfi = new MediaFileInfo(dr);
string fileContent = MediaSearchHelper.GetContent(mfi);
I create a Lucene.NET document:
Document doc = SearchHelper.CreateDocument(SearchHelper.CUSTOM_SEARCH_INDEX, mfi.FileID.ToString(), SearchHelper.INVARIANT_FIELD_VALUE, mfi.FileCreatedWhen, SearchHelper.INVARIANT_FIELD_VALUE);
I prepare the content field:
StringBuilder sb = new StringBuilder();
sb.Append(mfi.FileTitle);
sb.Append(" ");
sb.Append(mfi.FileDescription);
sb.Append(" ");
sb.Append(mfi.FileCustomData);
sb.Append(" ");
sb.Append(mfi.FileExtension);
sb.Append(" ");
sb.Append(mfi.FileMimeType);
sb.Append(" ");
sb.Append(mfi.FileName);
sb.Append(" ");
sb.Append(fileContent);
Then add it to the document (text in not in lowercase at this stage):
SearchHelper.AddField(doc, SearchHelper.CONTENT_FIELD, SearchHelper.HtmlToPlainText(sb.ToString()), false, true);
Finally I add the document to the index writer:
iw.AddDocument(doc);
When I export the index to XML using Luke I can see the information is stored in lowercase:
<doc id='1'>
<field name='_created' norm='1.0' flags='I-S--------'>
<val>20130508162047</val>
</field>
<field name='_culture' norm='1.0' flags='I-S--------'>
<val>invariantifieldivaluei</val>
</field>
<field name='_customcointent' norm='1.0' flags='I-S--------'>
<val>what should i use as a first aid symbol? international and canadian organizations responsible for standards recommend a white cross on a green background to identify a first aid kit or supplies or ...</val>
</field>
<field name='_customdate' norm='1.0' flags='I-S--------'>
<val>20130508162047</val>
</field>
<field name='_customtitle' norm='1.0' flags='I-S--------'>
<val>emblem title</val>
</field>
<field name='_customurl' norm='1.0' flags='I-S--------'>
<val>~/crc/mynewlibrary/emblem.pdf</val>
</field>
<field name='_id' norm='1.0' flags='I-S--------'>
<val>1196</val>
</field>
<field name='_myfiletype' norm='1.0' flags='I-S--------'>
<val>pdf</val>
</field>
<field name='_myid' norm='1.0' flags='I-S--------'>
<val>1196</val>
</field>
<field name='_site' norm='1.0' flags='I-S--------'>
<val>invariantifieldivaluei</val>
</field>
<field name='_type' norm='1.0' flags='I-S--------'>
<val>CUSTOM_SEARCH_INDEX</val>
</field>
</doc>
I appreciate any given help! Thank you!
Norm