Solr Sort by Title using solarium - sorting

I try to sort by title ascending using solr and Solarium.
I do this
$query->addSort('title', $query::SORT_ASC);
But it returns 500 whereas this
$query->addSort('itcreation_dateem_id', $query::SORT_ASC);
succeeds. How is it possible to do the sorting of title?

Related

How to sort (and give weight) by Availability dates in SolR

i'm facing a big problem in my SolR DB.
My objects have a datetime field "Available_From" and a datetime field "Available_To".
We also have a "Ranking" field for the sorting.
I can search correctly with direct queries (eg. give me all the items that are available at the moment) but when i do a regular search i cannot find a way to show the items that result "available NOW" in the first places in the results, usually sorted by "Ranking" field.
How can i do this? Am I forced to write some java classes (the nearest thing i've found is there https://medium.com/#devchaitu18/sorting-based-on-a-custom-function-in-solr-c94ddae99a12) or is there a way to do with standard SolR queries?
Thanks in advance to everyone!
In your case you actually don't want sorting, since that indicates that you want one field to determine the returned sequence of documents.
Instead, use boosting - apply a very large boost to those that are available now, either through bq or boost, then apply a boost based on ranking. You'll have to tweak the weights given to each part based on how you want the search results to be presented.

How should I sort by date results?: Solr

I'm trying to sort results by date. The server is using Solr technology. Earlier, I was using:
urldata.sort = 'last_modified desc';
to sort by date results. Now it seems to be not working. It throws error:
I referred to this answer regarding sort by date in Solr: How to sort by date in SOLR?
I tried to change 'last_modified desc' to 'published_date desc' but it seems to be not working. How should I proceed to solve this error?
The error isn't related to sorting, but that you aren't search a specific field for any particular value. Since there is no default field defined or specified in the URL, Solr has no idea what do with your search.
Try setting df in the URL, query a specific field foo:value or use qf (with (e)dismax) to specify which field Solr should sort.
Ordering, as long as the field is specified as a date field, should work automagically.

How can I sort a SOLR search on a Child Field

I am currently trying to sort a SOLR search based on a numeric value in a child document field.
I have recently learned that SOLR 6.6 has added support for this via a function query called childfield().
Can anyone please provide me an example of how to use this function properly? The documentation seems to be lacking and I keep getting an error that a sort order cannot be determined.
Preferably an explanation/example of the $bjq parameter usage would help also.

Google Search Appliance: Need to understand how sorting works

I want to understand how sorting works in GSA in below situations:
1) I am executing the query "Jayesh Bhoyar Autobiography" and I received 2000 records and in the query I have also mentioned sort by Date. So my understanding is GSA will pick Top 1000 records from above list based on the Relevance and then Sort it by Date?
However I want GSA should return only top 100 results for "Jayesh Bhoyar Autobiography" as per the relevance and sort on those top 100 records based on the Date. IS this possible?
If yes, how it is possible?
Regards,
Jayesh Bhoyar
The GSA can't do this by itself. If you want to do this, you can easily build a simple application that fetches the first hundred results sorted by relevance, then sorts those results by date. Use the simple XML API to fetch unformatted results from the GSA.
Search Protocol Reference

Drupal/ and solr views - how to sort?

a couple of questions ...
How can I sort items from solr index view ?
I'd like to set up a flag for nodes I get in that view and I'm wondering if there is any chance to sort by the flag count. Do I need to add a field to store the flagged count and index that too ?
thanks!
kladrian

Resources