Search Api Failing with a Bad Request from Solr

Search Api Failing with a Bad Request from Solr

This question is answered

I've been trying to get the Rest Search api to return results and all I get back is a 500 error.

I've copied the example given here.

telligent.com/.../list-search-results.aspx

I've replaced the api key/username as well as the url. I've used other api's and those are working well.

here's the stacktrace I get back when calling the API.. it seem that solr itself is returning a "Bad Request" error? But if I got directly to the server via :8080/solr it works fine.

To add further insult to injury, if I use the PublicApi in a widget it works fine.

Can anyone shed some light on this?

[WebException: The remote server returned an error: (400) Bad Request.]

  System.Net.HttpWebRequest.GetResponse() +7864708

  €—.—.˜(String url, Func`3 shouldIgnoreException) +192

[CSException: We apologize, but an unknown error has occurred during search. Please try your search again.]

  €—.—.˜(String url, Func`3 shouldIgnoreException) +1127

  Telligent.Evolution.Search.Solr.SolrSearchProvider.Ž˜(SearchQuery query, Boolean isMoreLikeThis) +313

  Telligent.Evolution.Search.Solr.SolrSearchProvider.Search(SearchQuery query, Boolean isMoreLikeThis) +54

  Telligent.Evolution.Components.Search.SearchService.Search(SearchQuery query) +107

  Telligent.Evolution.Rest.Resources.Search.SearchService.GetSearchResults(String query, String filters, String fieldFacets, String dateRangeFacets, String fieldFilters, String dateRangeFilters, String tags, Nullable`1 logicallyOrTags, String sort, Nullable`1 pageSize, Nullable`1 pageIndex, Nullable`1 startDate, Nullable`1 endDate, Nullable`1 collapse) +680

  Telligent.Evolution.Rest.Resources.Search.SearchController.List(SearchResultListRequest request) +761

Verified Answer
  • Thanks Kevin, after some further investigation,  It turns out that a user name also needs to be passed in the header as well as an api key.

    the example here "http://telligent.com/community/developers/w/developer6/list-search-results.aspx" is missing the "Rest User" which I found in another post.

All Replies
  • Would it be possible to get a fiddler trace between your website and job scheduler?  The site search is going to add several items to the URL that searching directly through solr admin panel is not going to do.
     
    Off hand, how many groups do you have?  One thing I have seen before – here - is for a user (ex. admin) who get put into a ton of roles (ex. a lot of groups on the site) and the URL gets pushed over the default limit of allowed chars in the URL for tomcat.  Just a thought.  Getting the request details is ideal.
     
    Kevin
     
    From: pfarina@hugeinc.com [mailto:bounce-pfarinahugeinccom@communities.telligent.com]
    Sent: Tuesday, November 06, 2012 12:15 PM
    To: discussion_evolution@communities.telligent.com
    Subject: [Telligent Evolution Platform Discussion] Search Api Failing with a Bad Request from Solr
     

    I've been trying to get the Rest Search api to return results and all I get back is a 500 error.

    I've copied the example given here.

    telligent.com/.../list-search-results.aspx

    I've replaced the api key/username as well as the url. I've used other api's and those are working well.

    here's the stacktrace I get back when calling the API.. it seem that solr itself is returning a "Bad Request" error? But if I got directly to the server via :8080/solr it works fine.

    To add further insult to injury, if I use the PublicApi in a widget it works fine.

    Can anyone shed some light on this?

    [WebException: The remote server returned an error: (400) Bad Request.]

      System.Net.HttpWebRequest.GetResponse() +7864708

      €—.—.˜(String url, Func`3 shouldIgnoreException) +192

    [CSException: We apologize, but an unknown error has occurred during search. Please try your search again.]

      €—.—.˜(String url, Func`3 shouldIgnoreException) +1127

      Telligent.Evolution.Search.Solr.SolrSearchProvider.Ž˜(SearchQuery query, Boolean isMoreLikeThis) +313

      Telligent.Evolution.Search.Solr.SolrSearchProvider.Search(SearchQuery query, Boolean isMoreLikeThis) +54

      Telligent.Evolution.Components.Search.SearchService.Search(SearchQuery query) +107

      Telligent.Evolution.Rest.Resources.Search.SearchService.GetSearchResults(String query, String filters, String fieldFacets, String dateRangeFacets, String fieldFilters, String dateRangeFilters, String tags, Nullable`1 logicallyOrTags, String sort, Nullable`1 pageSize, Nullable`1 pageIndex, Nullable`1 startDate, Nullable`1 endDate, Nullable`1 collapse) +680

      Telligent.Evolution.Rest.Resources.Search.SearchController.List(SearchResultListRequest request) +761

  • Thanks Kevin, after some further investigation,  It turns out that a user name also needs to be passed in the header as well as an api key.

    the example here "http://telligent.com/community/developers/w/developer6/list-search-results.aspx" is missing the "Rest User" which I found in another post.