Plugin Directory

Changeset 3442785


Ignore:
Timestamp:
01/19/2026 08:01:15 PM (2 months ago)
Author:
searchcraft
Message:

Deploy version 1.3.3

Location:
searchcraft/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • searchcraft/trunk/admin/class-searchcraft-admin.php

    r3441163 r3442785  
    14151415        }
    14161416
    1417         // Get the current index ID from configuration instead of using the constant
    1418         // which may be outdated if configuration was just saved.
    14191417        $index_id = Searchcraft_Config::get_index_id();
    14201418        if ( empty( $index_id ) ) {
     
    20862084            }
    20872085
     2086            $index_id = Searchcraft_Config::get_index_id();
     2087            if ( empty( $index_id ) ) {
     2088                Searchcraft_Helper_Functions::searchcraft_error_log( 'Searchcraft: Index ID is not configured.' );
     2089                return;
     2090            }
     2091
    20882092            try {
    2089                 $ingest_client->documents()->addDocuments( SEARCHCRAFT_INDEX_ID, $documents );
    2090                 $ingest_client->documents()->commitTransaction( SEARCHCRAFT_INDEX_ID );
     2093                $ingest_client->documents()->addDocuments( $index_id, $documents );
     2094                $ingest_client->documents()->commitTransaction( $index_id );
    20912095
    20922096                // Clear the index stats cache since document count has changed.
     
    21302134        }
    21312135
     2136        // Get the current index ID from configuration instead of using the constant
     2137        // which may be outdated if configuration was just saved.
     2138        $index_id = Searchcraft_Config::get_index_id();
     2139        if ( empty( $index_id ) ) {
     2140            Searchcraft_Helper_Functions::searchcraft_error_log( 'Searchcraft: Index ID is not configured.' );
     2141            return;
     2142        }
     2143
    21322144        $deleted_any = false;
    21332145        foreach ( $fields as $field ) {
    21342146            try {
    21352147                // Attempt to delete documents that match the field condition.
    2136                 $ingest_client->documents()->deleteDocumentsByField( SEARCHCRAFT_INDEX_ID, $field );
     2148                $ingest_client->documents()->deleteDocumentsByField( $index_id, $field );
    21372149                $deleted_any = true;
    21382150            } catch ( \Exception $e ) {
     
    21442156        if ( $deleted_any ) {
    21452157            try {
    2146                 $ingest_client->documents()->commitTransaction( SEARCHCRAFT_INDEX_ID );
     2158                $ingest_client->documents()->commitTransaction( $index_id );
    21472159
    21482160                // Clear the index stats cache since document count has changed.
     
    21652177        }
    21662178
     2179        // Get the current index ID from configuration instead of using the constant
     2180        // which may be outdated if configuration was just saved.
     2181        $index_id = Searchcraft_Config::get_index_id();
     2182        if ( empty( $index_id ) ) {
     2183            Searchcraft_Helper_Functions::searchcraft_error_log( 'Searchcraft: Index ID is not configured.' );
     2184            return;
     2185        }
     2186
    21672187        try {
    21682188            // Attempt to delete all documents in the index.
    2169             $ingest_client->documents()->deleteAllDocuments( SEARCHCRAFT_INDEX_ID );
     2189            $ingest_client->documents()->deleteAllDocuments( $index_id );
    21702190
    21712191            // Commit the transaction to make the changes visible.
    2172             $ingest_client->documents()->commitTransaction( SEARCHCRAFT_INDEX_ID );
     2192            $ingest_client->documents()->commitTransaction( $index_id );
    21732193
    21742194            // Clear the index stats cache since document count has changed.
     
    24252445        }
    24262446
     2447        // Get the current index ID from configuration instead of using the constant
     2448        // which may be outdated if configuration was just saved.
     2449        $index_id = Searchcraft_Config::get_index_id();
     2450        if ( empty( $index_id ) ) {
     2451            Searchcraft_Helper_Functions::searchcraft_error_log( 'Searchcraft: Index ID is not configured.' );
     2452            return;
     2453        }
     2454
    24272455        try {
    24282456            // Remove the document from the Searchcraft index by ID.
     
    24312459            );
    24322460
    2433             $ingest_client->documents()->deleteDocumentsByField( SEARCHCRAFT_INDEX_ID, $criteria );
     2461            $ingest_client->documents()->deleteDocumentsByField( $index_id, $criteria );
    24342462
    24352463            // Commit the transaction to make the changes visible.
    2436             $ingest_client->documents()->commitTransaction( SEARCHCRAFT_INDEX_ID );
     2464            $ingest_client->documents()->commitTransaction( $index_id );
    24372465
    24382466            // Clear the index stats cache since document count has changed.
  • searchcraft/trunk/readme.txt

    r3441163 r3442785  
    55Requires at least: 5.3
    66Tested up to: 6.9
    7 Stable tag:   1.3.2
     7Stable tag:   1.3.3
    88License:      Apache 2.0
    99License URI:  LICENSE.txt
     
    6969
    7070== Changelog ==
     71
     72= 1.3.3 =
     73* Bugfix - Fix race conditition on first time initialization.
    7174
    7275= 1.3.2 =
  • searchcraft/trunk/searchcraft.php

    r3441163 r3442785  
    1111 * Plugin URI:        https://github.com/searchcraft-inc/searchcraft-wordpress
    1212 * Description:       Bring fast, relevant search to your site. Searchcraft replaces the default search with a customizable, tunable, highly relevant search experience.
    13  * Version:           1.3.2
     13 * Version:           1.3.3
    1414 * Author:            Searchcraft, Inc.
    1515 * Author URI:        https://searchcraft.io/
     
    2727// Define plugin constants.
    2828if ( ! defined( 'SEARCHCRAFT_VERSION' ) ) {
    29     define( 'SEARCHCRAFT_VERSION', '1.3.2' );
     29    define( 'SEARCHCRAFT_VERSION', '1.3.3' );
    3030}
    3131
     
    5252// Load the main plugin class.
    5353require_once SEARCHCRAFT_PLUGIN_DIR . 'includes/class-searchcraft.php';
    54 
    55 // Define dynamic constants based on configuration.
    56 if ( ! defined( 'SEARCHCRAFT_INDEX_ID' ) ) {
    57     define( 'SEARCHCRAFT_INDEX_ID', Searchcraft_Config::get_index_id() );
    58 }
    5954
    6055/**
Note: See TracChangeset for help on using the changeset viewer.