manticoresearch-php icon indicating copy to clipboard operation
manticoresearch-php copied to clipboard

failed to set multiple wordforms

Open githubmanticore opened this issue 5 years ago • 2 comments

not quite sure how to set multiple wordform files for index

$params = [  
    'body' => [  
        'settings' => [  
             'wordforms' => '/usr/local/sphinx/data/wordforms.txt'  
        ],  
        'columns' => [  
            'title'=>['type'=>'text'],  
            'price'=>['type'=>'float']  
        ]  
    ],  
    'index' => 'products'  
];  
$index = new \Manticoresearch\Index($client);  
$index->create($params);  

however index with such config works well

index products {  
  wordforms = /usr/local/sphinx/data/wordforms.txt  
  wordforms = /usr/local/sphinx/data/alternateforms.txt  
    
  type = rt  
  path = idx  
  rt_field = title  
  rt_attr_uint = price  
}  

githubmanticore avatar May 05 '20 04:05 githubmanticore

Need to see first how this will be handled by Manticore.

adriannuta avatar May 05 '20 07:05 adriannuta

Maybe this one?

https://github.com/manticoresoftware/manticoresearch-php/blob/master/docs/indexclass.md#create

If a setting can have multiple values, an array of values will be used, like:

 $index->setName('mynewindex');
 $index->create([],
    [
        'type' => 'distributed',
        'local' => [
            'local_index_1',
            'local_index_2',
        ]
    ]
 );

d47081 avatar Nov 25 '23 14:11 d47081