drush commands not consistent with other contrib

Created on 27 January 2023, almost 2 years ago
Updated 3 July 2023, over 1 year ago

Problem/Motivation

If you list search related drush commands, then you see that the commands provided by this module have a not consistent naming:

search:                                                                                                                                                    
  search:api-index-fast (sapi-fast)                                          Indexes everything with use of multiple workers.                              
  search:api-index-fast-queue (sapi-ifq)                                     Indexes everything with use of multiple workers: queue worker.                
search-api:                                                                                                                                                
  search-api:clear (sapi-c)                                                  Clears one or all search indexes and marks them for reindexing.               
  search-api:disable (sapi-dis)                                              Disables one or more enabled search indexes.                                  
  search-api:disable-all (sapi-disa)                                         Disables all enabled search indexes.                                          
  search-api:enable (sapi-en)                                                Enables one disabled search index.                                            
  search-api:enable-all (sapi-ena)                                           Enables all disabled search indexes.                                          
  search-api:index (sapi-i)                                                  Indexes items for one or all enabled search indexes.                  

Proposed resolution

Rename commands to:

search-api:index-fast (sapi-fast)
search-api:index-fast-queue (sapi-ifq)

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

User interface

Created by

🇳🇱Netherlands batigolix Utrecht

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @batigolix
  • Status changed to Needs review almost 2 years ago
  • 🇳🇱Netherlands batigolix Utrecht

    Patch updates the drush commands

  • 🇳🇱Netherlands batigolix Utrecht

    Added the old command as alias

  • First commit to issue fork.
  • @ressa opened merge request.
  • 🇩🇰Denmark ressa Copenhagen

    Thanks @batigolix, looks good. But I think we should consider aligning the Drush commands even more. If you look at Search API and Search API Solr, this is the syntax:

    Search API

       * @command search-api:enable
       *
       * @usage drush search-api:enable node_index
       *   Enable the search index with the ID node_index.
       *
       * @aliases sapi-en,search-api-enable
    

    Search API Solr

       * @command search-api-solr:install-missing-fieldtypes
    

    In other words, first the project name replacing underscores with dashes, followed by the command, separated by a colon. What do you think about this instead?

    • search-api-fast:index
    • search-api-fast:fast-queue

    In the MR I also moved the * @usage drush [...] bit up, again to align with existing syntax.

    I cannot yet see 2.2.x here, so keeping Version at 2.0.x.

  • 🇩🇰Denmark ressa Copenhagen

    PS. The long aliases forces line breaks in the console ...

    search-api-fast:                                                                                                                  
      search-api-fast:fast-queue (sapi-ifq, search-api-index-fast-queue,              Indexes everything with use of multiple         
    search:api-index-fast-queue)                                                      workers: queue worker.                          
      search-api-fast:index (sapi-fast, search-api-index-fast, search:api-index-fast) Indexes everything with use of multiple         
    

    Perhaps these two aliases could get removed?

    • search-api-index-fast-queue
    • search-api-index-fast

    I do see these two lines, so it looks like more updating is needed, maybe replacing search-api-index-fast-queue with search-api-fast:fast-queue?

    • exec("ps -ef | grep 'search-api-index-fast-queue " . escapeshellarg($index_name) . "\b' | grep -v grep", $proclist);
    • exec('nohup ' . $drush . ' --uri=' . $base_url . ' search-api-index-fast-queue ' . $index_name . ' ' . $worker . ' > /dev/null 2>&1 &');
  • 🇩🇰Denmark ressa Copenhagen

    Looking at it some more, shouldn't it be this?

    search-api-fast:index-queue

    I have updated the MR to use that instead.

  • 🇳🇱Netherlands batigolix Utrecht

    Agree with your remark in #8
    I am gonne merge this

  • Status changed to Fixed over 1 year ago
  • 🇩🇰Denmark ressa Copenhagen

    It looks like dev-release of 2.x is not listed on the project page .

    Also, should the dev-version be 2.x and not 2.0.x?

    Examples of dev / current release branch numbering:

  • 🇳🇱Netherlands Johan den Hollander

    I think you are right about that Ressa. Just created a 2.x-dev release now.

  • 🇩🇰Denmark ressa Copenhagen

    Perfect, thanks @Johan den Hollander. The default Gitlab branch is 2.2.x, perhaps it should be 2.x?

    https://git.drupalcode.org/project/search_api_fast/

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024