[
https://issues.apache.org/jira/browse/SOLR-16514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17627281#comment-17627281
]
David Smiley commented on SOLR-16514:
-------------------------------------
BTW, very recently, Lucene stopped using JIRA; it's read-only. So I would not
have been able to migrate the issue even if I felt it to be a suitable "issue".
> lucene query: only QueryParser run well
> ---------------------------------------
>
> Key: SOLR-16514
> URL: https://issues.apache.org/jira/browse/SOLR-16514
> Project: Solr
> Issue Type: Task
> Security Level: Public(Default Security Level. Issues are Public)
> Components: clients - python
> Reporter: Nicola Paganotti
> Priority: Critical
> Labels: newbie
>
> {code:java}
> def searchGiustizia(self,startPagination,recPerPage):
> indexPath = File(self.fileLucene).toPath()
> directory = FSDirectory.open(indexPath)
> searcher = IndexSearcher(DirectoryReader.open(directory))
>
> paQuery5 = TermQuery(Term("parte","TELESI RICCARDO"))
> analyzer = StandardAnalyzer() print
> ("\n------------------------------------------------------")
> start = datetime.now()
> collector = TotalHitCountCollector()
> searcher.search(paQuery5, collector)
> print("found: ",collector.getTotalHits())
> duration = datetime.now() - start
> print("time ",str(duration))
> print ("\n------------------------------------------------------")
> {code}
> This function do a simple search in my Index of Apache Lucene. I use
> TermQuery but it return no results. If I use QueryParser, Lucene find me
> record with parte = "TELESI RICCARDO". Why doesn't TermQuery work?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]