lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shalin Shekhar Mangar <shalinman...@gmail.com>
Subject Re: Random Display of result in solr
Date Sat, 12 Sep 2009 03:52:13 GMT
On Fri, Sep 11, 2009 at 12:02 PM, dharhsana <rekha.dharshana@gmail.com>wrote:

>
> I am working on blog module,here the user will be creating more blogs,and
> he
> can post on it and have several comments for post.For implementing this
> module i am using solr 1.4.
>
> When i get blog details of particular user, it brings the result in random
> manner for
> (ex:) If i am passing blogid in the query to get my details,the result i
> got
> as ,if i have 2 result from it
>
>
To filter on a certain value for a field, you should pass
field-name:field-value. An example in your case will be userId:1


> This is the first result
>
> SolrDocument1{blogTitle=New Blog, blogId=New Blog, userId=1}]
> SolrDocument2{blogId=New Blog, postId=New Post, postTitle=New Post,
> postMessage=New Post Message, timestamp_post=Fri Sep 11 09:48:24 IST 2009}]
> SolrDocument3{blogTitle=ammu blog, blogId=ammu blog, userId=1}]
>
> The Second result
> SolrDocument1{blogTitle=New Blog, blogId=New Blog, userId=1}]
> SolrDocument2{blogTitle=ammu blog, blogId=ammu blog, userId=1}]
> SolrDocument3{blogId=New Blog, postId=New Post, postTitle=New Post,
> postMessage=New Post Message, timestamp_post=Fri Sep 11 09:48:24 IST 2009}]
>
> I am using solrj, when i am iterating the list i some times get
> ArrayIndexOutOfBoundException,because of my difference in the result.
>
> When i run again my code some other time ,it produces the proper result.so
> the list was changing all time.
>

Both the results contain the same number of documents (three), isn't it? The
list of documents returned by Solrj is never modifed by Solrj so I don't see
why you will get that exception.


> If anybody faced this type of problem ,please share with me..
>
> And  iam not able to get the specific thing ie if i am going to get blog
> details of particular user, so i will be passing blogtitle for ex: rekha
> blog , it is not giving only the rekha blog it also gives other blog which
> ends with blog (i..e sandhya blog,it brings even that and shows..).
>
>
You need to define what you want to retrieve. Do you want only exact matches
- case sensitive or case insensitive? Do you want full text matches with
exact match on top? Do you want to remove a particular word "blog" from your
index?

Also see http://wiki.apache.org/solr/SolrRelevancyCookbook

-- 
Regards,
Shalin Shekhar Mangar.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message