You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Nicola Paganotti (Jira)" <ji...@apache.org> on 2022/11/01 08:26:00 UTC

[jira] [Created] (SOLR-16514) lucene query: only QueryParser run well

Nicola Paganotti created SOLR-16514:
---------------------------------------

             Summary: 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


{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: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org