cancel
Showing results for 
Search instead for 
Did you mean: 

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

MOH_MCT
Champ in-the-making
Champ in-the-making

Hello,

Need your help to execute task where I need to search document based on custom model properties.

Task performed-

with Rest API POST '/nodes/{nodeId}/' - I have uploaded document.

As I already developed my content model aspect and property

with Rest API PUT '/nodes/{id}' - I have updated my document with content model property and based on this property I got my aspect name in response.

Task I need to Performed-

Based on this property I need to fetch my document.

Need your help to execute this task by using Rest API

20 REPLIES 20

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

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

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.

Try this

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

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?

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

Hi  @pjcaracuel_2349 

Still getting same issue.

EddieMay
World-Class Innovator
World-Class Innovator

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
Champ in-the-making
Champ in-the-making

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
Champ in-the-making
Champ in-the-making

Hi @EddieMay 

Any Update please?