Results 1 to 5 of 5
  1. #1
    farnetani is offline Member
    Join Date
    Nov 2008
    Posts
    1
    Rep Power
    0

    Default Doing the lucene remove character \n

    I need to do lucene find the sentence:
    ARLEI FERREIRA FARNETANI JUNIOR
    [arlei] [ferreira] [farnetani] [junior] (1)

    and too:

    ARLEI FERREIRA FAR- <break line>
    NETANI JUNIOR

    I'm using the Brazilian Analyzer, but the result is:
    [ARLEI] [FERREIRA] [FAR] [NETANI] [JUNIOR]

    I have to do that the lucene result:
    [ARLEI] [FERREIRA] [FARNETANI] [JUNIOR] equals the sentence (1)

    So I have to do that lucene remove "-" hyphen and the break line (\n).

    To remove character hyphen (-) I got, but remove the break line no!

    How do I do???

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    String str = "Your content ...." ;
    str.replaceAll("\n" ,"");

    Am i missing something ?
    dont worry newbie, we got you covered.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  4. #4
    piyu.sha is offline Member
    Join Date
    Oct 2008
    Posts
    31
    Rep Power
    0

    Default

    You should not tokenize the stuff when you are storing in index. and then it will do the exact match of sentance.


    ---------------------
    Music | HTS | Remix
    Live life king size
    [Lucene]

  5. #5
    Join Date
    Aug 2008
    Location
    Saint-Petersburg, Russia
    Posts
    66
    Rep Power
    0

    Default

    Quote Originally Posted by farnetani View Post
    I have to do that the lucene result:
    [ARLEI] [FERREIRA] [FARNETANI] [JUNIOR] equals the sentence (1)
    How do you query lucene ? Do you use query analyzer ? If yes, can you provide query text ?

Similar Threads

  1. Lucene Re-Indexing
    By connect2srinath in forum Lucene
    Replies: 1
    Last Post: 05-11-2008, 05:35 PM
  2. Apache Lucene 2.3.2
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 05-08-2008, 06:49 PM
  3. reading text character by character
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-09-2007, 08:54 PM
  4. Work On Lucene
    By peiceonly in forum Lucene
    Replies: 1
    Last Post: 08-07-2007, 05:47 PM
  5. Apache Lucene 2.2.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 06-22-2007, 12:47 AM

Posting Permissions

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