Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16514

lucene query: only QueryParser run well

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Critical
    • Resolution: Invalid
    • None
    • None
    • clients - python

    Description

          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------------------------------------------------------") 

      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?

      Attachments

        Activity

          People

            Unassigned Unassigned
            bigissue1 Nicola Paganotti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: