views – Search api Solr add fulltext search fields programmatically

I need to change fields in fulltext search fields programmatically.

I try this codes but nothing change:

function MY_MODULE_search_api_solr_query_alter(SolariumQueryInterface $solarium_query, QueryInterface $query) {

    $fields = $query->getFulltextFields();
    $fields() = 'field_competitor_code';

}

or this:

function MY_MODULE_search_api_solr_query_alter(SolariumQueryInterface $solarium_query, QueryInterface $query) {

    $query->setFulltextFields(('title_1', 'field_competitor_code'));

}

How can achieve this change?

Thanks in advance.

F.

php – Optimizing the FULLTEXT search query

Is there anything I can do to improve / optimize this full text search query? There are cases where it will NOT return records for someone with the name "Will" but will return for "William"

$search = implode(" ", array_map(function ($word) { return "+".$word."*"; }, explode(" ", $_GET('search'))));

$stmt = (new Database)->conn()->prepare("SELECT * FROM tickets_info WHERE MATCH(name, company, ticket, comments, notes) AGAINST(? IN BOOLEAN MODE) ORDER BY id DESC LIMIT 200");
$stmt->execute(array($search));

$results = $stmt->fetchAll();

if ($results) {

    header("Content-Type: application/json"); 
    echo json_encode($results);

} else {

    http_response_code(204);
    exit();

}

Full-text search: SQL Server 2012

I want to enable full-text search in the SQL server, the functionality already checked in the installation but in SQL when I make this request "select the ownership of the server (& # 39; IsFullTextInstalled & # 39;)"
The value 0 must be 1? How can I fix it?

SQL Server use of full-text index when using equal expression in where clause instead of contains

Can Microsoft SQL Server Use Text Index When Providing Where Clause in Format

select * from TABLE1 where TEXTCOLUMN1='UNIQUETEXTVALUE1'

We have a process flow engine that generates automated queries to retrieve the values ​​of process variables from the SQL Server database. The problem is that variable names are stored in the NVARCHAR (4000) column and most variable names contain a unique process number, so they are unique, while only a handful of records over a billion lines contain values ​​greater than 1700 bytes. This prevents indexing of this column via the normal index since few values ​​exceed the limit of 1700 bytes, but 99.99% of the values ​​are less than 128 bytes and unique.

As the engine we use is built by a third party, we don't have the ability to change the way queries are built and they are built by Alfresco Content Engine on the fly and frequently contain different joins and columns, but regularly refer to the values ​​in this column.

In some cases, other keys are not included, so the search requires significant server resources, as it performs the full analysis of the table, while the query plan shows that the query optimizer knows it is likely that it will only get 1 hit on the billion lines, it always performs a full scan as there is no suitable index for the built query .

We tried to truncate the few long values ​​and build the normal index on a table with a length of 512 characters, and this completely solves the problem. However, we cannot put this solution into production, because sometimes the long value would be filled and the engine would fail.

Can SQL Server use a text index for the query

select * from TABLE1 where TEXTCOLUMN1='UNIQUETEXTVALUE1'

in the same way, it would then execute this request

select * from TABLE1 where contains(TEXTCOLUMN1,'UNIQUETEXTVALUE1')

It would be good if SQL Server chooses to use the available text index if it is available for queries with where TEXTCOLUMN1 = & # 39; UNIQUETEXTVALUE1 & # 39; in the same way he does it with CONTAINS a function. Can this behavior be achieved in one way or another on SQL Server?

I tested this myself and Microsoft SQL Server 2016 does not use the full text index on the text column when searching for the exact value with an equal sign. My question for DBA experts is whether there is a way to configure this so that my requests run faster, since I cannot change the software that issues these requests?

views – How to get a replacement template for full-text search of the Search API in the header of the global text box

In Drupal 7, I currently use the default basic search and a view for node search results. I have a global text to extract the replacement model from the search term. I use the replacement model %1 as seen in the picture:

enter description of image here

Then I put You searched for: %1 in my global text to display the keywords sought:

enter description of image here

All of this works great for basic Drupal search, but can't I find a way to do it with the view in the search API? I am using the database service and a view created from the database index that I created. I have been trying to find a field such as keywords for full text search, but as the view is based on indexed content, I am not able to get this type of fields added, to make them available for tokens, even via relationships. Maybe there is a better way to create the view?

key set pagination on an extended query with full-text search in postgresql

I have a database with 4 tables. These 4 tables contain the users, their relationships with each other (the users following the other users), the publications that they make and the likes that they receive. I have simplified the tables for better understanding.

// table: users
+-------------------------------------------------+
| user_id | username | timestamp_joined | tokens  |
+-------------------------------------------------+

// table: followers
+-------------------------------------------------+
| follower_id | user_id | following_user_id       |
+-------------------------------------------------+

// table: posts
+-------------------------------------------------+
| post_id | user_id | timestamp_posted            |
+-------------------------------------------------+

// table: post_likes
+-------------------------------------------------+
| post_like_id | post_id | user_id                |
+-------------------------------------------------+

Now i want to make a full text search combined with a key ring pagination. I have successfully created a query for full-text search, but I cannot seem to modify this query for paging the key ring.

What I want

I want to search for users, but I don't want to classify them on user_id. I want to rank them on 3 things, listed below, in that order.

1) First, I want to classify them ts_rank(tokens, plainto_tsquery('search query')). The more matches there are between the tokens (a column containing a to_tsvector object) and the search query, the more the user should appear in the search results.

2) Second, I want to rank them based on their popularity. When 2 users have the same level of match in a search query, I want the most popular user to appear first. I created a small equation to calculate popularity. I know this is not a good equation, but for now (and for testing) it works. I will think of a better equation when everything works.

// equation parameters
d = # days user exists
f = # followers for a user
p = # posts made by a user in the last 5 days
l = total # likes on the posts made by the user in the last 5 days

// equation
(0.25 * d * (0.25 * f)) + (0.001 * d) + SQRT((f/d)) + ((0.1 * p) * (l/p))

3) When users always have the same level of match on a search query AND the same popularity, I want older users to appear first (ORDER BY user_id ASC).

First attempt to create a request (no key ring pagination yet)

The request to do all this is very extensive and I am not sure of the performance when the number of rows increases.

SELECT
    user_id,
    username,
    ts_rank(tokens, plainto_tsquery('search query')) AS search_rank,
    (
        (0.25 * (SELECT EXTRACT('day' FROM date_trunc('day', NOW() - timestamp_joined::date))) * (0.25 * ((SELECT COUNT(follower_id) FROM followers WHERE following_user_id = user_id)))
        +
        (0.001 * (SELECT EXTRACT('day' FROM date_trunc('day', NOW() - timestamp_joined::date))))
        +
        (SQRT(((SELECT COUNT(follower_id) FROM followers WHERE following_user_id = user_id)/(SELECT EXTRACT('day' FROM date_trunc('day', NOW() - timestamp_joined::date)))))
        +
        ((0.1 * (SELECT COUNT(post_id) FROM posts WHERE user_id = user_id AND timestamp_posted > NOW() - INTERVAL '5 DAY')) * ((SELECT COUNT(post_like_id) FROM post_likes WHERE post_id IN (SELECT post_id FROM posts WHERE user_id = user_id))/(SELECT COUNT(post_id) FROM posts WHERE user_id = user_id AND timestamp_posted > NOW() - INTERVAL '5 DAY')))
    ) AS popularity_rank
FROM
    users
ORDER BY
    search_rank DESC,
    popularity_rank DESC,
    user_id ASC

As you can see, this is a complicated query (especially with the equation), with 9 SELECT instructions in it. But the request works.

My questions

1) First, I want to know something about the performance of this request. I'm a beginner and I really don't know how PostgreSQL works in the back. 9 SELECT statements in 1 request, to me, that sounds like a lot. Will performance drop when the database reaches, say, 1,000,000 records in each table? Will adding indexes to tables be helpful?

2) Second, I want to know how to add a key ring pagination to this request.

I know it's a lot, but I wanted to ask a question for a better overview.

Thanks in advance!

performances – optimize the query with a fulltext index in mysql

I have a column inside my mysql table which has a full text index and I have to make a query in which I get all the rows which have no specific word or those that start with these letters, so I have the following query:

SELECT *
FROM products
WHERE NOT MATCH(title) AGAINST('Do*' IN BOOLEAN MODE);

Technically, this query works, but does it perform a full analysis of my table, so is there another approach to be able to perform this query by taking advantage of the index and without finishing with a full analysis of my table?

how to filter contains online full-text search sharing post-query

Battery exchange network

The Stack Exchange network includes 175 question and answer communities, including Stack Overflow, the largest and most reliable online community for developers who want to learn, share knowledge and develop their careers.

Visit Stack Exchange

Search for an iFilter to Use for the SQL Server Full-Text Index of IBM Notes .eml Documents

I'm looking for an iFilter for IBM Notes eml documents.

After rebuilding a full-text catalog and rebuilding its unique full-text index, run DMV sys.dm_fts_index_keywords_by_document resulted in the following for each IBM Notes eml document:

  • key word: 0xFF
  • display_term: END OF FILE
  • occurrence_count: a

If such an iFilter does not exist, I look for alternative solutions for this scenario.

  • An option: Automatically convert IBM Notes eml documents to another file format, preferably without significantly increasing the file size.

Environment:

  • SQL Server 2016 Enterprise 64-bit
  • Windows Server 2012 R2 Standard 64-bit

SQL Server 2017 – `CHANGE_TRACKING = AUTO` fails to populate the full-text index

I have created full-text indexes on tables with the following (simplified) options:

CREATE FULLTEXT INDEX ON (schema).(table)  
(  
    ColumnA Language 'English',
    ColumnB Language 'English'
)  
KEY INDEX pk_table ON database_ft_catalog 
WITH
    CHANGE_TRACKING = AUTO,
    STOPLIST = OFF
GO  

It works and records are searchable after building the index.

Select Top 100 * from (schema).(table)
  where contains(*, '"searchTerm*"');

My problem is that the records are not automatically populated in the full-text index as they should be.

At one point, I saw in the newspapers that the full-text demons were dead, so I restarted those who were using sp_fulltext_service 'restart_all_fdhosts'. (sys.fulltext_indexes showed that a complete population was still in progress.)

It worked for a while, but now the new records are not indexed yet. This is my last error message:

A full-text retry pass of Auto population started for table or indexed view
Error '0x80004005' occurred during full-text index population for table or indexed view
Informational: Full-text retry pass of Auto population completed for table or indexed view '(db).(schema).(table)'... Number of retry documents processed: 1. Number of documents failed: 1.

Any information on how to solve this problem would be greatly appreciated. Records fail 4 times. They are then ignored, that is, they are no longer tracked and will no longer appear in the index of the full text until I rebuild them.

For your information, I tried to increase the ism_size as shown in this article. However, this did not solve the problem. (I know it's an older version, but it was worth it.)