Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Chintan Akhani
Issue while doing sorting by title on search results
March 29, 2013 11:29 AM
Answer

Chintan Akhani

Rank: Regular Member

Posts: 111

Join Date: March 13, 2008

Recent Posts

Hi,

We have a custom portlet for search (we are using solr search) . I am getting an exception in case of performing sort by title (in case of web content results). Sort by modified date is working fine but sort by title is not working. We are using Solr 1.4 and Liferay 6.0

Thanks,
Chintan
Atin Agarwal
RE: Issue while doing sorting by title on search results
April 1, 2013 5:14 AM
Answer

Atin Agarwal

Rank: Junior Member

Posts: 84

Join Date: February 19, 2012

Recent Posts

Share your code for more clarity.
Chintan Akhani
RE: Issue while doing sorting by title on search results
April 10, 2013 12:21 PM
Answer

Chintan Akhani

Rank: Regular Member

Posts: 111

Join Date: March 13, 2008

Recent Posts

I found the solution for sort by title issue with solr 1.4. Below is the solution for same.

1. Open scema.xml file into solr plugin and solr server, create a custom field called "newTitle", and it's type should be "string".
2. After fields tag completed, add one tag called "copyField", this tag has two attributes, source and dest. keep "newTitle" as source and "title" as dest.
3. Now make a small change into your java code of sorting, change the sort by field to "newTitle" instead of "title" and it will work for you.