How to search document based on custom model properties using Rest API

cancel
Showing results for 
Search instead for 
Did you mean: 
angelborroy
Alfresco Employee

Re: How to search document based on custom model properties using Rest API

Logs doesn't help.

That should be working.

Try the same query using Node Browser or any other tool to be sure that it works and it's not a REST API problem.

Hyland Developer Evangelist
pjcaracuel_2349
Active Member II

Re: How to search document based on custom model properties using Rest API

Hi,

This query is working for me.

{
  "query": {
    "query""(name:\"FAC*\" OR title:\"FACT*\") AND TYPE:\"fact:folder_fact\""
  },
  "paging": {
    "maxItems""25",
    "skipCount""10"
  }
 }
 
I have the correct folder number in the response.
{
    "list": {
        "pagination": {
            "count"0,
            "hasMoreItems"false,
            "totalItems"1,
            "skipCount"10,
            "maxItems"25
        },
        "context": {
            "consistency": {
                "lastTxId"229
            }
        },
        "entries": []
    }
}
 
I only see a difference with your code. I'm using standard alfresco metadata and you a custom metadata. Let me think because I 'm trying the same as you.
 
{
  "query": {
    "query""(+@fact:cif:\"22*\") AND TYPE:\"fact:folder_fact\""
  },
  "paging": {
    "maxItems""25",
    "skipCount""10"
  }
 }
This call run without error
MOH_MCT
Customer

Re: How to search document based on custom model properties using Rest API

Hi @pjcaracuel_2349 and @angelborroy 

 

I am using 

{
  "query": {
    "query": "TYPE:\"cm:content\" AND od:ReObjID:\"OmGanesh\""
  }
}
As JSON Payload where ReObjID is my custom property and OmGanesh is value for that can you help me out why i am unable to fetch.
pjcaracuel_2349
Active Member II

Re: How to search document based on custom model properties using Rest API

Try this

"query": "TYPE:\"cm:content\" AND (+@od:ReObjID:\"OmGanesh\")"

MOH_MCT
Customer

Re: How to search document based on custom model properties using Rest API

Hi @pjcaracuel_2349 

I tried with the JSON you mentioned i.e

{
"query":{
"query": "TYPE:\"cm:content\" AND (+@od:ReObjID:\"OmGanesh\")"}
}

i am getting following error:

{ "error": { "errorKey": "framework.exception.ApiDefault", "statusCode": 500, "briefSummary": "05260097 Request failed 500 /solr/alfresco/afts?wt=json&fl=DBID%2Cscore&rows=100&df=TEXT&start=0&locale=en_US&alternativeDic=DEFAULT_DICTIONARY&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON", "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": "99150429-9c53-4821-a0ad-8373e85e8fbf" } }

 

Can you help me  with this?

 

pjcaracuel_2349
Active Member II

Re: How to search document based on custom model properties using Rest API

Can you put the metadata definition for od:ReObjID ?

Also you can try without TYPE:\"cm:content\" AND

as

{
"query":{
"query": "(+@od:ReObjID:\"OmGanesh\")"}
}

Thanks

EddieMay
Alfresco Employee

Re: How to search document based on custom model properties using Rest API

Hi @MOH_MCT,

This might be an index issue - see this solution.

HTH

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
MOH_MCT
Customer

Re: How to search document based on custom model properties using Rest API

Hi  @pjcaracuel_2349 

 

Still getting same issue.

MOH_MCT
Customer

Re: How to search document based on custom model properties using Rest API

Hi @EddieMay 

 

Can you please guide me more about indexing. How to configure and how to check that indexing working properly or not?

one more thing even from alfresco share we are not able to search.

Note-Solution you mentioned in your comment inside it links which is pointing indexing with solr6 is giving error Page not Found error.

 

MOH_MCT
Customer

Re: How to search document based on custom model properties using Rest API

Hi @EddieMay 

Any Update please?