FAQ
Hi,



In lucene document I have added a field in the following manner -



document.Add(new Field("desc", reader.ReadString(), Field.Store.NO,
Field.Index.TOKENIZED));



The field "desc" has got lots of text because of which I don't want to store
it in index, but want to make it searchable.



Now for the display purpose, how can I show the content of the same filed -
"decs" ?



Thanks,

Sudhanya


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Search Discussions

  • Jokin Cuadrado at Mar 4, 2008 at 11:17 am
    you have to save the origin of that text (primary key on database, file
    uri) an read it from his original source.

    Jokin.

    Jatorrizko mezua: ar., 2008-03-04 16:09 +0530, egilea: Sudhanya
    Chatterjee
    Hi,



    In lucene document I have added a field in the following manner -



    document.Add(new Field("desc", reader.ReadString(), Field.Store.NO,
    Field.Index.TOKENIZED));



    The field "desc" has got lots of text because of which I don't want to store
    it in index, but want to make it searchable.



    Now for the display purpose, how can I show the content of the same filed -
    "decs" ?



    Thanks,

    Sudhanya


    DISCLAIMER
    ==========
    This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
  • Sudhanya Chatterjee at Mar 12, 2008 at 4:30 am
    Hi,

    We are using Lucene.net for creating our search application.

    Query creation is done using QueryParser.

    Using this how to make the search case insensitive?



    For example - if the search term is "Sudhanya" I get results having
    "Sudhanya" and not "sudhanya".

    Requirement is to get both listed.



    Thanks,

    Sudhanya


    DISCLAIMER
    ==========
    This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
  • Vijay Santhanam at Mar 12, 2008 at 6:31 am
    Hi Sudhanya,

    What analyser are you using to parse the query and index the "name" field?

    The StandardAnalyzer, SimpleAnalyzer and others will use the
    LowercaseTokenizer to automatically lower case your field/query terms.

    Hope that helps


    Vijay Santhanam
    B.Eng.(Soft.)
    Spectrum Wired - Software Engineer

    T: +61 2 4925 3266
    F: +61 2 4925 3255
    M: +61 407 525 087
    W: www.spectrumwired.com


    Disclaimer: This email and any attached files are intended solely for the
    named addressee, are confidential and may contain legally privileged
    information. The copying or distribution of them or any information they
    contain, by anyone other than the addressee, is prohibited. If you have
    received this email in error, please let us know by telephone or return the
    email to the sender and destroy all copies. Thank you.



    -----Original Message-----
    From: Sudhanya Chatterjee
    Sent: Wednesday, 12 March 2008 3:30 PM
    To: lucene-net-user@incubator.apache.org
    Subject: lucene.net query

    Hi,

    We are using Lucene.net for creating our search application.

    Query creation is done using QueryParser.

    Using this how to make the search case insensitive?



    For example - if the search term is "Sudhanya" I get results having
    "Sudhanya" and not "sudhanya".

    Requirement is to get both listed.



    Thanks,

    Sudhanya


    DISCLAIMER
    ==========
    This e-mail may contain privileged and confidential information which is the
    property of Persistent Systems Ltd. It is intended only for the use of the
    individual or entity to which it is addressed. If you are not the intended
    recipient, you are not authorized to read, retain, copy, print, distribute
    or use this message. If you have received this communication in error,
    please notify the sender and delete all copies of this message. Persistent
    Systems Ltd. does not accept any liability for virus infected mails.
  • Sudhanya Chatterjee at Mar 17, 2008 at 2:15 pm
    Hi,



    In our application we are using WildcardQuery to fetch the results.

    Is it possible to get specific range of results?

    For example -

    Search results contain 100 records.

    We want only the result from 11th record till 20th record.

    Is it possible to do this without iterating through the full
    result set?

    OR

    Is it possible to fire a query where we can specify the start
    and the number of records required?



    Thanks,

    Sudhanya


    DISCLAIMER
    ==========
    This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
  • Michael Garski at Mar 17, 2008 at 5:07 pm
    Sudhanya,

    It sounds like you just want a specific 'page' of the results, rather than the entire set, correct?

    Lucene does not have any built in functionality for this, and I would suggest persisting the results after a query is executed and then paging through them.

    Michael

    -----Original Message-----
    From: Sudhanya Chatterjee
    Sent: Monday, March 17, 2008 7:15 AM
    To: lucene-net-user@incubator.apache.org
    Subject: lucene.net query

    Hi,



    In our application we are using WildcardQuery to fetch the results.

    Is it possible to get specific range of results?

    For example -

    Search results contain 100 records.

    We want only the result from 11th record till 20th record.

    Is it possible to do this without iterating through the full
    result set?

    OR

    Is it possible to fire a query where we can specify the start
    and the number of records required?



    Thanks,

    Sudhanya


    DISCLAIMER
    ==========
    This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
  • Digy at Mar 17, 2008 at 7:33 pm
    Hi Sudhanya,

    I think a little bit different than Michael. Iterating over all hits is a slow process.
    Therefore repeating the search for each "page" and fetching the results(say 10 or 20) like below
    may result in a faster response to the user.
    (I think no one retrieves all of the result pages of a google search).

    pageNum=3;
    numDocs = 10; //Result for one "page"
    startOffset = pageNum*numDocs;

    TopDocs result = indexSearcher.Search(query, null, startOffset + numDocs);
    for (int i = startOffset; i < startOffset+ numDocs; i++)
    {
    Document doc = indexSearcher.Reader.Document(result.scoreDocs[i].doc));
    ......
    }



    DIGY



    -----Original Message-----
    From: Michael Garski
    Sent: Monday, March 17, 2008 7:03 PM
    To: lucene-net-user@incubator.apache.org
    Subject: RE: lucene.net query

    Sudhanya,

    It sounds like you just want a specific 'page' of the results, rather than the entire set, correct?

    Lucene does not have any built in functionality for this, and I would suggest persisting the results after a query is executed and then paging through them.

    Michael

    -----Original Message-----
    From: Sudhanya Chatterjee
    Sent: Monday, March 17, 2008 7:15 AM
    To: lucene-net-user@incubator.apache.org
    Subject: lucene.net query

    Hi,



    In our application we are using WildcardQuery to fetch the results.

    Is it possible to get specific range of results?

    For example -

    Search results contain 100 records.

    We want only the result from 11th record till 20th record.

    Is it possible to do this without iterating through the full
    result set?

    OR

    Is it possible to fire a query where we can specify the start
    and the number of records required?



    Thanks,

    Sudhanya


    DISCLAIMER
    ==========
    This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
  • Erich Eichinger at Mar 17, 2008 at 8:11 pm
    At least for version 1.4.3 a can confirm, that DIGYs approach works perfectly since I have got it in production for quite a long time now. I don't expect that this behaviour has changed much.

    Here's the code I use for this:

    struct SearchResult
    {
    public float Score; public int DocId; public Document Doc;

    public SearchResult(float score, int docId, Document doc) { Score=score; DocId=docId; Doc=doc; }
    }

    ArrayList Search(IndexSearcher indexSearcher, Query query, Filter filter, Sort sort, int startIndex, int count)
    {
    if (startIndex < 0) throw new ArgumentOutOfRangeException("startIndex must be >= 0");
    Hits hits = indexSearcher.Search(query, filter, sort);
    if (count == -1) count = hits.Length();
    int maxIndex = Math.Min(startIndex + count - 1, hits.Length() - 1);
    ArrayList resultRange = new ArrayList();
    for (int i = startIndex; i <= maxIndex; i++)
    {
    resultRange.Add(new SearchResult(hits.Score(i), hits.Id(i), hits.Doc(i)));
    }
    return resultRange;
    }

    -Erich

    ________________________________

    From: Digy
    Sent: Mon 2008-03-17 20:32
    To: lucene-net-user@incubator.apache.org
    Subject: RE: lucene.net query



    Hi Sudhanya,

    I think a little bit different than Michael. Iterating over all hits is a slow process.
    Therefore repeating the search for each "page" and fetching the results(say 10 or 20) like below
    may result in a faster response to the user.
    (I think no one retrieves all of the result pages of a google search).

    pageNum=3;
    numDocs = 10; //Result for one "page"
    startOffset = pageNum*numDocs;

    TopDocs result = indexSearcher.Search(query, null, startOffset + numDocs);
    for (int i = startOffset; i < startOffset+ numDocs; i++)
    {
    Document doc = indexSearcher.Reader.Document(result.scoreDocs[i].doc));
    ......
    }



    DIGY



    -----Original Message-----
    From: Michael Garski
    Sent: Monday, March 17, 2008 7:03 PM
    To: lucene-net-user@incubator.apache.org
    Subject: RE: lucene.net query

    Sudhanya,

    It sounds like you just want a specific 'page' of the results, rather than the entire set, correct?

    Lucene does not have any built in functionality for this, and I would suggest persisting the results after a query is executed and then paging through them.

    Michael

    -----Original Message-----
    From: Sudhanya Chatterjee
    Sent: Monday, March 17, 2008 7:15 AM
    To: lucene-net-user@incubator.apache.org
    Subject: lucene.net query

    Hi,



    In our application we are using WildcardQuery to fetch the results.

    Is it possible to get specific range of results?

    For example -

    Search results contain 100 records.

    We want only the result from 11th record till 20th record.

    Is it possible to do this without iterating through the full
    result set?

    OR

    Is it possible to fire a query where we can specify the start
    and the number of records required?



    Thanks,

    Sudhanya


    DISCLAIMER
    ==========
    This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouplucene-net-user @
categorieslucene
postedMar 4, '08 at 10:40a
activeMar 17, '08 at 8:11p
posts8
users6
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase