Monday, July 11, 2016

SharePoint 2013: cannot sort Content Search webpart results by document Title property

Problem

A customer employed a Content Search webpart on an organizational home page to present search results involving documents having specific properties.  The Content Search webpart had been deployed and configured by a designer no longer available.  The webpart was displaying the appropriate documents, but these documents, as listed in the webpart, were not being sorted by document title.  These documents, and most documents throughout the site collection presented differences between their filenames and document titles - the two are hardly ever the same.  The customer needed these document results to be sorted by the document title.  However, the documents were being listed and sorted by filename.  The customer had repeatedly tried to change the search criteria herself to implement sorting by document title, but had not been successful.  The customer then opened a support ticket.

Troubleshooting

  1. Check webpart: verified that it is a standard OOTB Content Search webpart.
  2. Check Content Search query: tested the query on development instance and verified that the query generates the expected document listing output, just not sorted per customer needs.
  3. Check Content Search query sorting: configured using Filename property Descending.
  4. Configure Title property for sorting: could not find Title property in Sort by dropdown.
  5. Verify Title property is being crawled: found the Title property among properties being crawled.
  6. Verify Title property Sort configuration: found that the Title property Sortable parameter was set to No.
    1. Action: Set the Sortable property to Yes - active, and then clicked OK.
  7. Verify Title property appears in query sorting: found the property properly listed in the Sort by dropdown.
    1. Action: launched a full crawl.  Waited for crawl to complete.
  8. Configure Title property for sorting: set sorting by the Title property Ascending, and then applied changes: documents listed in the Content Search web part now sorted by Title ascending.

Solution

  • If unable to find this or other property in the Sort by dropdown, on the SORTING tab of the Build Your Query dialog, verify that the propery's Sortable parameter has been set appropriately.  It's this managed property parameter that determined whether the property will appear listed for sorting purposes.

References

  • The Content Search webpart employs the Build Your Query dialog tool to enable creating and modifying of content search queries.
  • To find a specific crawled property and check its configuration, first go: Central Administration > Search Administration > Queries and Results > Search Schema > Crawled Properties tab > [enter "Title" and then click the arrow].  
  • Curiously, after setting the Sortable parameter of the Title property to Yes-active , I found the property immediately appearing in the Sort by dropdown.  Moreover, I also found that I could configure sorting using this property.  However, the results would only appear descending, regardless of whether I selected the Sort by to be Ascending or Descending.  Once I performed a full crawl and tested this again, the displayed results responded to changes here as expected.

No comments: