Results 1 to 2 of 2
  1. #1
    koolmelee is offline Member
    Join Date
    Sep 2011
    Rep Power

    Default Getting the term object from a string.

    I have a school assignment that uses lucene. Essentially, I have to implement a very basic search just using normalized term frequency(per docuemnt).

    I store the term frequency in a hash table(Document=>term frequency).

    What I need to know is how to get at a Term object given the term as a string.

    I understand how to iterate over all the terms, but how can I just get at the Term object for the specified string.

    For example, I would like to do something like this:
    Java Code:
    IndexReader r ="...");
    Term t = r.getTerm("myterm");
    Also, how do you get the term frequencies given a Document object?
    Last edited by koolmelee; 09-17-2011 at 10:00 AM.

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Rep Power

    Default Re: Getting the term object from a string.

    Hi. I decided that it is not correct question. You can find Document's object, Then you can get all fields from this Document. then you can create any Term yourself. So Why do you want to get Term?
    Skype: petrarsentev

Similar Threads

  1. Replies: 0
    Last Post: 09-06-2011, 05:59 PM
  2. Casting a String object to a Form object
    By kakinyim in forum CLDC and MIDP
    Replies: 0
    Last Post: 04-23-2011, 12:41 PM
  3. Number of searched term in Documents
    By MrUni in forum Lucene
    Replies: 0
    Last Post: 12-14-2010, 04:00 PM
  4. Object to String.
    By Gelembjuk in forum New To Java
    Replies: 6
    Last Post: 10-29-2008, 11:19 PM
  5. String vs Object
    By Gilgamesh in forum New To Java
    Replies: 1
    Last Post: 11-28-2007, 11:26 PM

Tags for this Thread

Posting Permissions

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