lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aslam bari <iamasla...@yahoo.co.in>
Subject Re: Words Frequency Problem
Date Fri, 18 Aug 2006 06:41:44 GMT
Thanks Doron,
   
  My Code is as below please tell me where to add/modify for TermFreqVector.
   
  IBasicResultSet result = new BasicResultSetImpl (false);
          try
        {
            Searcher searcher = new IndexSearcher(indexPath);
              Query query = QueryParser.parse(searchedText, TextContentIndexer.CONTENT_TEXT,
analyzer);
            
            
            Hits hits = searcher.search (query);
            int noOfHits = hits.length();
            
            
            for (int i = 0; i < noOfHits; i++)
            {
                Document doc = hits.doc(i);   
                
                String uri = doc.get(TextContentIndexer.URI_FIELD);
                IBasicQuery q = factory.getQuery();
                String scope = q.getSearchToken().getSlideContext().getSlidePath(q.getScope().getHref());
                if (uri.startsWith(scope)) {
                    RequestedResource resource = createResource(uri);
                    result.add (resource);
                }
            }
        }
   
   
  I have another question, if i am searching for "circle red color", then by default it uses
"OR" as i think. If i want to search exact word "red color" , then how can i query for this.

Doron Cohen <DORONC@il.ibm.com> wrote:
  See
http://www.nabble.com/Accessing-%22term-frequency-information%22-for-documents-tf1964461.html#a5390696


- Doron

aslam bari wrote on 17/08/2006 23:13:27:

> Dear All,
> I am new to Lucene. I am searching for a word "circle" in my
> indexed document list. It gives me total document found 4 i.e. Hits.
> But now i want to get how many occurances are there in each document
> i.e. frequency of words in result document. Plz. give me suggestions.
>
> Thanks...
>
>
> ---------------------------------
> Here's a new way to find what you're looking for - Yahoo! Answers
> Send FREE SMS to your friend's mobile from Yahoo! Messenger Version
> 8. Get it NOW


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org



 				
---------------------------------
 Here's a new way to find what you're looking for - Yahoo! Answers 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message