dcsimg
How can i use (:) colon in searching???
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   nithya_vembu
Posted On:   Thursday, July 13, 2006 11:47 PM

Hi All, I am working in lucene. Now i am facing a problem with :(colon).In my program i am indexing the following documents. String str[]={ "SERVICE:Test FOLDER:Track RESOURCE:nithya", "SERVICE:Test FOLDER:Track RESOURCE:adhil" }; for (int i=0;i Document d = new Document(); d.add(Field.Text("ALL",str[i])); writer.addDocument(d); } and i am searching like that Searcher searcher = new IndexSearcher("D:/JavaStudy/index"); String SearchData[]={ "SERVICE:Test", "SERVICE:Test FOLDER:Track RESOURCE:adhil" "SERVICE:Test FOLDER:Track -RESOURCE:adhil". This is my code   More>>

Hi All,
I am working in lucene. Now i am facing a problem with :(colon).In my program i am indexing the following documents.
String str[]={
"SERVICE:Test FOLDER:Track RESOURCE:nithya",
"SERVICE:Test FOLDER:Track RESOURCE:adhil"
};
for (int i=0;i
Document d = new Document();
d.add(Field.Text("ALL",str[i]));
writer.addDocument(d);
}
and i am searching like that
Searcher searcher = new IndexSearcher("D:/JavaStudy/index");
String SearchData[]={
"SERVICE:Test",
"SERVICE:Test FOLDER:Track RESOURCE:adhil"
"SERVICE:Test FOLDER:Track -RESOURCE:adhil".

This is my code snippet.

Now my problem is when i use "SERVICE:Test" it failed to search and retrieve the related documents.But if i directly give the values as "Test", its working. There was problem with colon. Similarly i am facing problem in Time field and weblink field(http:\yahoo.com).
Its very necessity for me to use (:) for fields Advanced search. Is there any way to use colon(:)?? If possible plz try to give me a better solution.

With Regards,
V.Nithya.

   <<Less

Re: How can i use (:) colon in searching???

Posted By:   Otis_Gospodnetic  
Posted On:   Friday, July 14, 2006 11:32 PM

That's some unreadable code.
Look up QueryParser javadoc and look for escape methods.
Also ensure that your analyzer doesn't remove ":" character.
About | Sitemap | Contact