Announcement

Collapse
No announcement yet.

Enable 'fuzzy' search for all entities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enable 'fuzzy' search for all entities

    Hi - I'd like to enable all searches to perform as if they were of the form %<search-term>%.

    I tried to hack this:
    Code:
    diff --git a/frontend/client/src/views/record/search.js b/frontend/client/src/views/record/search.js
    index b05a1ff..6d9b65c 100644
    --- a/frontend/client/src/views/record/search.js
    +++ b/frontend/client/src/views/record/search.js
    @@ -401,7 +401,7 @@ Espo.define('Views.Record.Search', 'View', function (Dep) {
    
             loadSearchData: function () {
                 var searchData = this.searchManager.get();
    -            this.textFilter = searchData.textFilter;
    +            this.textFilter = searchData.textFilter.slice(1, searchData.textFilter.length-1);
    
                 if ('presetName' in searchData) {
                     this.presetName = searchData.presetName;
    @@ -442,7 +442,7 @@ Espo.define('Views.Record.Search', 'View', function (Dep) {
             },
    
             fetch: function () {
    -            this.textFilter = this.$el.find('input[name="textFilter"]').val();
    +            this.textFilter = '%' + this.$el.find('input[name="textFilter"]').val() + '%';
    
                 this.bool = {};
    but maybe there's a cleaner way?

  • #2


    SelectManagers can be extended for certain entity.

    Comment


    • #3
      Brill, I just enabled it for all search terms which are varchar too. Doesn't slow anything down for me.

      Diff here but probably not wanted for you guys

      Comment

      Working...
      X