am trying to implement a LuceneIndex into a project of mine. First basic implementations worked fine and my methods returns the searched results
Now, I tried to store and documents in the index like this..
doc.add(new StringField("uriNote", note.getUri(), Field.Store.YES));
doc.add(new StringField("uriPatient", note.getPatientUri(), Field.Store.YES));
doc.add(new TextField("text", note.getText(), Field.Store.YES));
What I now want to do is to search through the index by a query which says.. must exact have this PatientUri and have some keywords in the text..
I'm trying this..
String queryString = "uriPatient:" + request.getPatientUri() + " AND text:" + request.getSearchString();
Query query = new QueryParser(Version.LUCENE_43, "text",analyzer).parse(queryString);
int hitsPerPage = 10;
this.searcher = new IndexSearcher(this.reader);
TopScoreDocCollector collector = TopScoreDocCollector.create(hitsPerPage, true);
searcher.search(query, collector);
ScoreDoc[] hits = collector.topDocs().scoreDocs;
It seems like Lucene troubles with parsing the URL..
Any Ideas to fix that ? ^^
Thanks in forcast..