diff -r ae3f1779f6da -r a5fbfefd615f searchengine/cpix/tsrc/cpixsample/src/cpixsample.cpp --- a/searchengine/cpix/tsrc/cpixsample/src/cpixsample.cpp Thu May 27 13:59:44 2010 +0300 +++ b/searchengine/cpix/tsrc/cpixsample/src/cpixsample.cpp Fri Jun 11 14:43:47 2010 +0300 @@ -1,19 +1,3 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ // INCLUDE FILES #include @@ -41,14 +25,15 @@ #define FIELD_ALPHA L"Alpha" +#define FIELD_ALPHA1 L"Alpha1" #define DOC1CONTENT L"mary had little lamb issue its anirban fleece was black as coal" -#define DOC2CONTENT L"sri rama jeyam shankar.rajendran@yahoo.co.in www.google.com U.S.A. file.txt" +#define DOC2CONTENT L"sri rama jeyam and it 3gpp_70.jpg 170(kb).jpg is shankar.rajendran@yahoo.co.in then www.google.com U.S.A. file.txt" // The term that will be present in multiple documents. -#define SEARCH_TERM L"$prefix(\"a\")" +#define SEARCH_TERM L"$prefix(\"had\")" int testInit(cpix_Analyzer **analyzer_, cpix_IdxDb **idxDb_) @@ -103,11 +88,15 @@ { cpix_Document *doc; cpix_Field field; + cpix_Field field1; + cpix_Field field2; + cpix_Field field3; cpix_Result result; doc = cpix_Document_create(&result,docUid,NULL, // app class NULL, // excerpt NULL); // mime type + if (cpix_Failed(&result)) { printf("Failed to create a document\n"); @@ -117,7 +106,24 @@ cpix_Field_initialize(&field, FIELD_ALPHA, data, - cpix_STORE_YES |cpix_INDEX_TOKENIZED); + cpix_STORE_YES |cpix_INDEX_UNTOKENIZED | cpix_AGGREGATE_YES | cpix_FREE_TEXT ); + + cpix_Field_initialize(&field1, + FIELD_ALPHA1, + data, + cpix_STORE_YES |cpix_INDEX_UNTOKENIZED | cpix_AGGREGATE_YES); + + + cpix_Field_initialize(&field2, + L"ALPHA2", + L"This is shankar and I am working for nokia", + cpix_STORE_YES |cpix_INDEX_TOKENIZED | cpix_AGGREGATE_YES | cpix_FREE_TEXT ); + + + cpix_Field_initialize(&field3, + L"ALPHA3", + L"This is shankar and I am working for nokia", + cpix_STORE_NO |cpix_INDEX_TOKENIZED | cpix_AGGREGATE_YES); if (cpix_Failed(&field)) { @@ -126,6 +132,9 @@ return 0; } cpix_Document_add(doc,&field); + cpix_Document_add(doc,&field1); + cpix_Document_add(doc,&field2); + cpix_Document_add(doc,&field3); cpix_IdxDb_add(*idxDb_,doc,*analyzer_); cpix_Document_destroy(doc);