207 TBuf<KMaxFileName> docidString; |
207 TBuf<KMaxFileName> docidString; |
208 docidString.Append( aAppInfo.iUid.Name() ); //This returns descriptor in the form "[UID]". So remove the brackets. |
208 docidString.Append( aAppInfo.iUid.Name() ); //This returns descriptor in the form "[UID]". So remove the brackets. |
209 docidString = docidString.Mid( KUidStartIndex, KUidEndIndex ); |
209 docidString = docidString.Mid( KUidStartIndex, KUidEndIndex ); |
210 |
210 |
211 CSearchDocument* document = CSearchDocument::NewLC( docidString, _L(APPLICATIONS_APPCLASS) ); |
211 CSearchDocument* document = CSearchDocument::NewLC( docidString, _L(APPLICATIONS_APPCLASS) ); |
|
212 //The UID field should not be aggregated for now as we dont want it to be searchable by default. |
|
213 //By default, all tokenized fields are aggregated and therefore searchable. |
|
214 //If we dont tokenize, then the field will not be searchable at all. |
|
215 //As a middle path, we tokenize this field, but explicitly chose NOT to aggregate it. |
|
216 //That way, if a client is interested in the UID field, he can choose to query it explicitly. |
212 document->AddFieldL(KMimeTypeField, KMimeTypeApplication, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized ); |
217 document->AddFieldL(KMimeTypeField, KMimeTypeApplication, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized ); |
213 document->AddFieldL(KApplicationFieldUid, docidString, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized ); |
218 document->AddFieldL(KApplicationFieldUid, docidString, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EAggregateNo ); |
214 |
219 |
215 if( iWidgetRegistry.IsWidget( aAppInfo.iUid ) ) |
220 if( iWidgetRegistry.IsWidget( aAppInfo.iUid ) ) |
216 AddWidgetInfoL( document, aAppInfo.iUid ); |
221 AddWidgetInfoL( document, aAppInfo.iUid ); |
217 else |
222 else |
218 AddApplicationInfoL( document, aAppInfo ); |
223 AddApplicationInfoL( document, aAppInfo ); |