Page 2 of 2 FirstFirst 12
Results 21 to 37 of 37

Thread: Lucene issue

  1. #21
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    hi petr.

    i solve that already..this is due to my own mistake in the naming conventions..

    QueryParser queryParser = new QueryParser(FIELD_PATH, analyzer);
    should be FIELD_CONTENTS because its supposed to analyse the content of text files..oh gosh..thanks petr for the feedback.

  2. #22
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    Hi petr,

    I am trying to do term frequencies now. how does this term frequency works?for example againts one document from one article in wikipidea and compare it against the documents that i have?thanks for the feedback.

  3. #23
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    It's very difficult to understand what you want. What you mean about " the term frequency works "?
    Skype: petrarsentev
    http://TrackStudio.com

  4. #24
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    hmm..basically i am trying get all the terms from one website talking about for example ;food in wikipidea. And then trying to count their frequencies in my document collections. Thanks.

  5. #25
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    sry i mean related to foods.

  6. #26
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    In my example above I count total number of terms which has special word. You can try it.
    Skype: petrarsentev
    http://TrackStudio.com

  7. #27
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    Hi,

    Lets say i have already stored the terms from a webpage inside an arraylist and i wanted to compare terms against my index collection, how should i go about it?thanks.

  8. #28
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Can you create a short example?
    Skype: petrarsentev
    http://TrackStudio.com

  9. #29
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    hmm

    lets say i have all the terms from a webpage eg : banana, melon, apple.

    and i want to count their (the terms) frequencies inside my index collections.

    and assign indenpendent weight so i am able to rank them according to top 15 documents. Thanks.

  10. #30
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    i am trying to use some of the frequencies like using match like this but i dont its supported at my lucene version. Thanks.

  11. #31
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Why can't you update a version Lucene?
    Skype: petrarsentev
    http://TrackStudio.com

  12. #32
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    hi,

    i am trying not to use much of the package capabilities. Thanks.

    Any suggestions on my previous questions?thanks.

  13. #33
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    hi,

    Can term function in lucene support an arraylist? basically i am trying to list all the terms from arraylist with their frequencies.thanks.

  14. #34
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    Hi,

    This code below that i written based on the description of the API in lucene only able to read one specific term only which i need to specify.

    Java Code:
    IndexReader ir = IndexReader.open(INDEX_COLLECTION);        
            Term term = new Term(FIELD_CONTENTS, "stock");     
            TermDocs termDocs = ir.termDocs(term);
           
            int collectionFreq = 0;
            while (termDocs.next()) {
               // System.out.print("Document " + termDocs.doc() + " contains the term " + term.text() + " ");
                //System.out.println(termDocs.freq() + " times");
                collectionFreq += termDocs.freq();
    
            }
             ir.close();
           
            //System.out.println(term.text());
          System.out.println("Collection frequency of " + term.text() + " = " + collectionFreq);
    How to make it able to read many terms?thanks.

  15. #35
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    Java Code:
    IndexReader ir = IndexReader.open(INDEX_COLLECTION);        
            Term term = new Term(FIELD_CONTENTS, "stock");     
            TermDocs termDocs = ir.termDocs(term);
           
            int collectionFreq = 0;
            while (termDocs.next()) {
                collectionFreq += termDocs.freq();
            }
             ir.close();
          
          System.out.println("Collection frequency of " + term.text() + " = " + collectionFreq);
    much clearer code.thanks.

  16. #36
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Where did you find this documentation?
    Skype: petrarsentev
    http://TrackStudio.com

  17. #37
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default

    hi all,

    how to calculate boosting?thanks. there is a doc.setBoost(). how to calculate the value inside?thanks.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Lucene beginner. HELP!!!
    By adbawany in forum Lucene
    Replies: 2
    Last Post: 01-22-2011, 12:18 PM
  2. Monitoring lucene
    By arumilli in forum Lucene
    Replies: 0
    Last Post: 08-05-2010, 06:40 PM
  3. Indexing XML using lucene
    By peliukasss in forum Lucene
    Replies: 0
    Last Post: 03-28-2010, 11:20 PM
  4. Apache Lucene
    By dkarthiin in forum Lucene
    Replies: 0
    Last Post: 03-25-2010, 01:25 PM
  5. Apache Lucene 2.3.2
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 05-08-2008, 07:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •