cancel
Showing results for 
Search instead for 
Did you mean: 

Search by custom properties

dzider
Champ on-the-rise
Champ on-the-rise

Hi everybody,

1) I want to implement searching by custom properties. I created a data model with custom properties and added new fields to the facetFields in app.config.json.
They are displayed in the application but every (string type) option is preceded with the "{en}" prefix. When a user clicks on an option, search returns 0 results. Does anyone know how to get rid of the prefix and fix this?

2) I would also like to use the data-range component for the dates in the future (currently it's impossible to select future dates). Is that possible?

Thanks for your help!

image

1 ACCEPTED ANSWER

panacasp
Champ on-the-rise
Champ on-the-rise

We got it working now, actually we didn't reindex Solr correctly but after following the instructions it worked and the prefixes aren't showing anymore.

View answer in original post

8 REPLIES 8

EddieMay
World-Class Innovator
World-Class Innovator

Hi @dzider,

There's a thread here that refers to using future date searches , along the lines of:

"query" : "=facp:empresa:'CSSL' and facp:fechafac:[NOW/YEAR TO NOW/YEAR+1YEAR]"

HTH

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

dzider
Champ on-the-rise
Champ on-the-rise

Hey @EddieMay,

I've been able to use the queries to filter by future dates...
e.g.:

    "facetQueries": {
      "label": "Some Date",
      "expanded": false,
      "queries": [
        {
          "label": "SEARCH.FACET_QUERIES.TODAY",
          "query": "uibkVMa:Date:[TODAY to TODAY]"
        },
        {
          "label": "This Week",
          "query": "uibkVMa:Date:[TODAY TO NOW/DAY+7DAYS]"
        },
        {
          "label": "This Year",
          "query": "uibkVMa:Date:[TODAY TO NOW/DAY+1YEAR]"
        }
      ]
    },

... but I wanted to use the Search date range component specifically (link), so the user can chose the time period freely. I don't think I can put any query specifying future dates here:

    "categories": [
      {
        "id": "createdDateRange",
        "name": "SEARCH.CATEGORIES.CREATED_DATE",
        "enabled": true,
        "component": {
          "selector": "date-range",
          "settings": {
            "field": "cm:created",
            "dateFormat": "DD-MMM-YY"
          }
        }
      },

More importantly, any idea about the {en} prefixes preceding custom properties (point 1)?

Thanks for your help!

Hi, we have an open issue for the dates https://github.com/Alfresco/alfresco-ng2-components/issues/5122.

About the en prefix. Have you check is not something that comes from your response in the network ?

Check for all the call with /public/search/versions/1/search 

dmondardo
Champ in-the-making
Champ in-the-making

Hi @dzider ,
the {en} prefix problem seems related to your Solr instance configuration.
Do you have the same problem using Alfresco Share search page?

You need to add multilanguage support on your Solr configuration file, see point 5 of our documentation: https://docs.alfresco.com/search-enterprise/tasks/solr-install.html (assuming you're using Alfresco Search Service).
This are the lines to add to the 'shared.properties' Solr configuration file:

alfresco.cross.locale.datatype.0={http://www.alfresco.org/model/dictionary/1.0}text
alfresco.cross.locale.datatype.1={http://www.alfresco.org/model/dictionary/1.0}content
alfresco.cross.locale.datatype.2={http://www.alfresco.org/model/dictionary/1.0}mltext 

After the change you need to reindex your Solr.

Let me know if this solves your issue.

Technical Support Engineer @ Alfresco

Hi, we're having the same problem with the {en} prefix showing up on custom properties.

We added the lines on shared.properties file and reindexed Solr but we're still experiencing this problem. In Alfresco Share search page we get 'undefined' followed by the property value.

panacasp
Champ on-the-rise
Champ on-the-rise

We got it working now, actually we didn't reindex Solr correctly but after following the instructions it worked and the prefixes aren't showing anymore.

EddieMay
World-Class Innovator
World-Class Innovator

Hi @panacasp,

Thanks for updating us on how you resolved your issue - very helpful to other users.

I'll mark this as solved if I may? 

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

I have the same "undefined" prefix before the property values.
I am using community version via SDK/dokcer.
I did not install Alfresco Search Services so I have no solrhome path.

Can I still have place to add the configuration parameters? Or should I look for other methods?

BTW,
Some properties in search responses have {en} as their prefixes but some properties have no {en} as their prefixes.
They are all of type "d:text". Is there a way to make them consistent?