Solr Lucene Scoring and Sorting problems

I'm not having much luck finding Solr help, but hopefully someone can help.

I've just set up Solr and am able to do searches but am unable to sort and the default scoring doesn't seem to be working.  Does something need to be done to enable scoring and sorting in Solr?  

I've tried every example that I could find online, which Solr seems to completely ignore.  Neither of these did anything:

somewords ;Popularity desc
somewords &sort=Popularity desc

The scoring doesn't seem to be doing anything either.  My search results come back in the order that they are stored every time.  Exact matches are not ordered any higher than partials.

I know this isn't a specific sorlnet issue, but I don't know where to turn, as there is so little documentation to help.  Please advise.

Thanks,

Justin
JT_SIROAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cwiedmannCommented:
You are adding the &sort= to the url, not to the query, right?  It would help if you can post the URL of the query.
0
JT_SIROAuthor Commented:
I'm using the Solrnet class to access Solr, so I don't actually build a URL per se.  I use the .Query method of Solrnet, like this:

        var solr = ServiceLocator.Current.GetInstance<ISolrOperations<TrackInfo>>();
        var results = solr.Query("keyword1 -ExcludeWord &sort=Popularity asc");

It searches the text I pass it, as well as exclude text, but the sort is ignored.

There's very little documentation on this.  Does it look like I'm using it incorrectly?
0
JT_SIROAuthor Commented:
I read that the string passed in the solr.Query() function is passed to the q parameter for Solr.

Additional name / value parameters can be accessed by SolrNet, but they need to be declared.  Maybe I need to create one for sort.

You'd think that sorting would be built in to solrnet

0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

cwiedmannCommented:
As you surmised, adding the &sort=Popularity asc to the q parameter won't work.  Just add a parameter "sort" with the value "Popularity asc".  It looks like you can do this in Solrnet by passing a dictionary with those values.
0
JT_SIROAuthor Commented:
cwiedmann - I'll give you the points - sorry for the delay and thanks.  I'm getting closer but still super slow searching...

Do you happen to know how to restrict the results set (documents) to 25?  I've limited my data grid to 25 results per page, but it's still very slow when say 1000 results come back.  I'm guessing this is because Solr is actually returning all 1000 recs, even though I'm only displaying 25.  It looks like my defaults are set for 10 in solrconfig, but it appears that Solrnet bi-passes that and gets everything.  

I also need to set my Start param so I can do paging.  I was able to figure out how to handle the Sort parameter, by adding the following to my Solr.Query:
new QueryOptions().AddOrder(new SolrNet.SortOrder("Popularity", Order.DESC)

But I don't see anything like this to set the Rows or Start parameters.  This should be so much easier, but it's clear that .NET users haven't worked with this much yet.  Please advise!

Thanks -

Justin
0
cwiedmannCommented:
All of these parameters turn into pretty simple query string parameters to Solr, so you should just be able to add start and rows generically.  From my reading of SolrNet they seemed to have a way of adding arbitrary parameters by passing in a Dictionary of values - I would try this if you can't find a more supported way of doing this.

Having said that, the performance issue is not likely to be caused by this since it's the server that defaults to 10 records, not the client.  Have you optimised your index? If the index is very fragmented, it'll affect performance.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JT_SIROAuthor Commented:
Good information but no specific Solrnet examples.  Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.