Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-4419

400 Bad Request "jobTitle is not a valid search facet" empty facets

    XMLWordPrintable

    Details

    • Attachments:
      0
    • Comments:
      0
    • Documentation Status:
      Needed

      Description

      I'm having an issue related with discovery (400 error) for some person facets like jobTitle, knowsLanguage, ....
      Just a side note, I don't have any values for these fields and I'm using the default discovery.xml (from DSpace master branch).

      The request:
      https://localhost/server/api/discover/search/objects?sort=score,DESC&page=0&size=10&configuration=person

      retrieves:

      {
        "id" : null,
        "scope" : null,
        "query" : null,
        "appliedFilters" : null,
        "sort" : {
          "by" : "score",
          "order" : "DESC"
        },
        "configuration" : "person",
        "type" : "discover",
        "_links" : {
          "self" : {
            "href" : "https://localhost/server/api/discover/search/objects?configuration=person"
          }
        },
        "_embedded" : {
          "searchResult" : {
      (...)
          },
          "facets" : [ {
            "name" : "jobTitle",
            "facetType" : "text",
            "facetLimit" : 5,
            "_links" : {
              "self" : {
                "href" : "https://localhost/server/api/discover/facets/jobTitle?configuration=person"
              }
            },1
            "_embedded" : {
              "values" : [ ]
            }
          }, {
            "name" : "knowsLanguage",
            "facetType" : "text",
            "facetLimit" : 5,
            "_links" : {
              "self" : {
                "href" : "https://localhost/server/api/discover/facets/knowsLanguage?configuration=person"
              }
            },
            "_embedded" : {
              "values" : [ ]
            }
          }, {
            "name" : "birthDate",
            "facetType" : "date",
            "facetLimit" : 5,
            "_links" : {
              "self" : {
                "href" : "https://localhost/server/api/discover/facets/birthDate?configuration=person"
              }
            },
            "_embedded" : {
              "values" : [ ]
            }
          } ]
        }
      }
      

      and, for each facet without results, I'm getting a 400 Bad Request error:

      {{Request URL: https://localhost/server/api/discover/facets/jobTitle?page=0&size=5&sort=score,DESC&page=0&size=10
      Request Method: GET
      Status Code: 400 400}}

      {"timestamp":"2020-01-15T11:42:02.473+0000","status":400,"error":"Bad Request","message":"An Exception has occured","trace":"org.dspace.app.rest.exception.DSpaceBadRequestException: jobTitle is not a valid search facet
      	at org.dspace.app.rest.utils.DiscoverQueryBuilder.addFacetingForFacets(DiscoverQueryBuilder.java:138)
      	at org.dspace.app.rest.utils.DiscoverQueryBuilder.buildFacetQuery(DiscoverQueryBuilder.java:109)
      	at org.dspace.app.rest.repository.DiscoveryRestRepository.getFacetObjects(DiscoveryRestRepository.java:145)
      	at org.dspace.app.rest.DiscoveryRestController.getFacetValues(DiscoveryRestController.java:193)
      	at sun.reflect.GeneratedMethodAccessor268.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      (...)
      ","path":"/server/api/discover/facets/jobTitle"}
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            paulo_graca Paulo Graça
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: