You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dharhsana <re...@gmail.com> on 2009/09/11 08:32:54 UTC

Random Display of result in solr

Hi to all, 

I have an issue while i am working with solr. 

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 

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. 

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..). 

what should i do for this ,any specific query should be given ,i am using
solrj.. using this how to make my query to get my prompt result. 

Waiting for your reply 

Regards, 

Rekha. 
-- 
View this message in context: http://www.nabble.com/Random-Display-of-result-in-solr-tp25395746p25395746.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Random Display of result in solr

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Sep 11, 2009 at 12:02 PM, dharhsana <re...@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.

Re: Random Display of result in solr(Can anyone please answer to this post )

Posted by dharhsana <re...@gmail.com>.
Hi Team ,

Can anyone please answer to this post ....

I have an issue while i am working with solr. 

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 

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. 

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..). 

what should i do for this ,any specific query should be given ,i am using
solrj.. using this how to make my query to get my prompt result. 

Waiting for your reply 

Regards, 

Rekha. 



dharhsana wrote:
> 
> Hi to all, 
> 
> I have an issue while i am working with solr. 
> 
> 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 
> 
> 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. 
> 
> 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..). 
> 
> what should i do for this ,any specific query should be given ,i am using
> solrj.. using this how to make my query to get my prompt result. 
> 
> Waiting for your reply 
> 
> Regards, 
> 
> Rekha. 
> 

-- 
View this message in context: http://www.nabble.com/Random-Display-of-result-in-solr-tp25395746p25397538.html
Sent from the Solr - User mailing list archive at Nabble.com.