Sorting custom properties with search api and PATH

cancel
Showing results for 
Search instead for 
Did you mean: 
pdovhomilja
Partner

Sorting custom properties with search api and PATH

AHello,

i'm trying sorting everything by cutoom properties, but when i will use PATH in query, than server return 500. For example, i would like to get results for my custom type "ssl:document" and my property "sslSmiley Tongueid". If i will use query as bellow i will get response with 500

{
  "error": {
    "errorKey": "framework.exception.ApiDefault",
    "statusCode": 500,
    "briefSummary": "03021026 Request failed 500 /solr/alfresco/afts?wt=json&fl=DBID%2Cscore&rows=5&df=TEXT&start=0&locale=en_US&alternativeDic=DEFAULT_DICTIONARY&sort=cm%3Aauthor+desc&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON&fq=%7B%21afts%7D%28-ASPECT%3A%22clf%3Aclassified%22+OR+%28sc%3Aclassification%3A%22TS%22+OR+sc%3Aclassification%3A%22S%22+OR+sc%3Aclassification%3A%22C%22+OR+sc%3Aclassification%3A%22U%22+%29%29",
    "stackTrace": "For security reasons the stack trace is no longer displayed, but the property is kept for previous versions",
    "descriptionURL": "https://api-explorer.alfresco.com",
    "logId": "cd5118d0-f13c-455c-98de-4b9de0beb4d0"
  }
}

this doesn't work:

{
   "paging":{
"maxItems":5,
"skipCount":0
}, "query":{
"language":"afts",
"query":"PATH:'/app:company_home/st:sites/cm:Mailroom/cm:documentLibrary/cm:Unfinished//*' AND TYPE:'ssl:document'"
}, "sort":{ "ascending":false, "field":"ssl:pid", "type":"FIELD" } }

 

also this doesn't work

{
   "paging":{
      "maxItems":5,
      "skipCount":0
   },
   "query":{
      "language":"afts",
      "query":"PATH:'/app:company_home/st:sites/cm:Mailroom/cm:documentLibrary/cm:Unfinished//*'"
   },
   "sort":{
      "ascending":false,
      "field":"cm:author",
      "type":"FIELD"
   }
}

 

but this works:

{
   "paging":{
      "maxItems":5,
      "skipCount":0
   },
   "query":{
      "language":"afts",
      "query":"TYPE:'ssl:document'"
   },
   "sort":{
      "ascending":false,
      "field":"ssl:pid",
      "type":"FIELD"
   }
}

Any idea how to sort by my properties and keep PATH in the query?

Thank you

 
4 Replies
angelborroy
Alfresco Employee

Re: Sorting custom properties with search api and PATH

Can you see any other stack trace in the log?

Hyland Developer Evangelist
angelborroy
Alfresco Employee

Re: Sorting custom properties with search api and PATH

How 

"ssl:pid"

is defined?

Hyland Developer Evangelist
pdovhomilja
Partner

Re: Sorting custom properties with search api and PATH

I'm sorry, i can not, my knowlege is not so high, i'm learning Alfresco. My model is looking like this

 

  <type name="ssl:parent">
      <title>SSL Parent</title>
      <parent>cm:content</parent>
      <properties>
        <property name="ssl:customAuditCode">
          <title>Custom Audit Code</title>
          <type>d:text</type>
          <mandatory>true</mandatory>
        </property>
        <property name="ssl:pid">
          <title>PID</title>
          <type>d:text</type>
          <protected>true</protected>
          <mandatory>true</mandatory>
        </property>
      </properties>
  </type>
pdovhomilja
Partner

Re: Sorting custom properties with search api and PATH

Ah, i see, i have to add this to each property? With this index enabled it works...

<index enabled="true">
    <atomic>true</atomic>
    <stored>false</stored>
    <tokenised>false</tokenised>
    <facetable>true</facetable>
</index>