Plugin Directory

Changeset 3263660


Ignore:
Timestamp:
03/29/2025 12:20:37 AM (12 months ago)
Author:
oc3dots
Message:

Refining queries by adding keywords to each user search request that is sent to the semantic database.

Location:
oc3-semantic-box/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • oc3-semantic-box/trunk/lib/controllers/AdminConfigController.php

    r3234031 r3263660  
    491491                $config_pinecone_confidence = (int)$_POST[OC3SEMANTICB_PREFIX_LOW . 'config_pinecone_confidence'];
    492492                update_option(OC3SEMANTICB_PREFIX_LOW . 'config_pinecone_confidence', $config_pinecone_confidence);
     493            }
     494           
     495            if (isset($_POST[OC3SEMANTICB_PREFIX_LOW . 'rag_keywords'])) {
     496                $rag_keywords = sanitize_text_field(wp_unslash($_POST[OC3SEMANTICB_PREFIX_LOW . 'rag_keywords']));
     497                update_option(OC3SEMANTICB_PREFIX_LOW . 'rag_keywords', $rag_keywords);
    493498            }
    494499           
  • oc3-semantic-box/trunk/lib/controllers/PublicSearchController.php

    r3234031 r3263660  
    107107            $config_pinecone_topk = sanitize_text_field(get_option(OC3SEMANTICB_PREFIX_LOW . 'config_pinecone_topk', 10));
    108108            $config_pinecone_confidence = (int) (get_option(OC3SEMANTICB_PREFIX_LOW . 'config_pinecone_confidence', ''));
    109 
     109            $additional_keywords = sanitize_text_field(get_option(OC3SEMANTICB_PREFIX_LOW . 'rag_keywords', ''));
     110            if(strlen(trim($additional_keywords)) > 0){
     111                $search .= '  '.$additional_keywords;
     112            }
    110113            if (!class_exists('Oc3Semanticb_RagUtils')) {
    111114                require_once OC3SEMANTICB_PATH . '/lib/helpers/RagUtils.php';
  • oc3-semantic-box/trunk/oc3-semantic-box.php

    r3234031 r3263660  
    88  Text Domain: oc3-semantic-box
    99  Domain Path: /lang
    10   Version: 1.0.1
     10  Version: 1.0.2
    1111  License:  GPL-2.0+
    1212  License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
  • oc3-semantic-box/trunk/readme.txt

    r3234031 r3263660  
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    10 Stable tag: 1.0.1
     10Stable tag: 1.0.2
    1111
    1212Semantic search of website content with meaning...
     
    2121* Personalize the appearance of the search box: colors, styles, text, search result
    2222* Ability to choose whether the search field will be visible only to registered visitors or not.
    23 
     23* Refining queries by adding  keywords to each user search request that is sent to the semantic database.
    2424 
    2525
     
    8787== Changelog ==
    8888
     89= 1.0.2 =
     90* Refining queries by adding  keywords to each user search request that is sent to the semantic database.
     91
    8992= 1.0.1 =
    9093* Launch!
  • oc3-semantic-box/trunk/views/backend/config_gpt_general.php

    r3234031 r3263660  
    467467                                    </div>
    468468                                </div>
    469                                
     469                                <div class="oc3semanticb_block_content">
     470                                            <div class="oc3semanticb_row_header">
     471                                                <label for="oc3semanticb_rag_keywords"  font-weight: 700;"><?php esc_html_e('Additional Keywords', 'oc3-semantic-box'); ?> *:</label>
     472                                            </div>
     473                                            <div class="oc3semanticb_row_content oc3semanticb_pr">
     474                                                <div style="position: relative;">
     475                                                    <?php $rag_keywords = get_option('oc3semanticb_rag_keywords', ''); ?>
     476                                                    <input type="text" id="oc3semanticb_rag_keywords"
     477                                                           name="oc3semanticb_rag_keywords"
     478                                                           value="<?php echo esc_html($rag_keywords); ?>" />
     479                                                </div>
     480                                                <p class="oc3semanticb_input_description">
     481                                                    <span style="display: inline;">
     482                                                        <?php esc_html_e('Additional keywords will be added to each user search request that is sent to the semantic database. This is useful for refining queries. For example, if you have a knowledge database about Woocommerce, but a user types the question: What are the attributes of an order item? This query may be considered irrelevant by the vector database and result in no records being returned. But when you add Woocommerce as an additional keyword, the following text will be sent to the semantic database: “What are the attributes of an order item? Woocommerce”. Thus, additional keywords improve queries.. ', 'oc3-semantic-box'); ?>
     483                                                    </span>
     484                                                </p>
     485                                            </div>
     486                                </div>
    470487                               
    471488                                </div> 
Note: See TracChangeset for help on using the changeset viewer.