full-text-search

MongoDB Full Text on an Array within an Array of Elements

和自甴很熟 提交于 2020-08-27 05:58:39
问题 I am unable to retrieve documents when an array within an array of elements contains text that should match my search. Here are two example documents: { _id: ..., 'foo': [ { 'name': 'Thing1', 'data': { 'text': ['X', 'X'] } },{ 'name': 'Thing2', 'data': { 'text': ['X', 'Y'] } } ] } { _id: ..., 'foo': [ { 'name': 'Thing3', 'data': { 'text': ['X', 'X'] } },{ 'name': 'Thing4', 'data': { 'text': ['X', 'Y'] } } ] } By using the following query, I am able to return both documents: db.collection.find

c# searching large text file

拈花ヽ惹草 提交于 2020-08-21 06:56:13
问题 I am trying to optimize the search for a string in a large text file (300-600mb). Using my current method, it is taking too long. Currently I have been using IndexOf to search for the string, but the time it takes is way too long (20s) to build an index for each line with the string. How can I optimize searching speed? I've tried Contains() but that is slow as well. Any suggestions? I was thinking regex match but I don't see that having a significant speed boost. Maybe my search logic is

c# searching large text file

余生颓废 提交于 2020-08-21 06:55:44
问题 I am trying to optimize the search for a string in a large text file (300-600mb). Using my current method, it is taking too long. Currently I have been using IndexOf to search for the string, but the time it takes is way too long (20s) to build an index for each line with the string. How can I optimize searching speed? I've tried Contains() but that is slow as well. Any suggestions? I was thinking regex match but I don't see that having a significant speed boost. Maybe my search logic is

How to correctly create thesaurus dictionary for my custom text search configuration

生来就可爱ヽ(ⅴ<●) 提交于 2020-08-10 18:57:37
问题 I use PostgreSQL 11.8. And for Postgres, I use the docker image postgres:11-alpine . I want to create a custom full text search dictionary for expressions which are based on some words, like hello world should become hw . First of all I have a custom full text search configuration my_swedish : CREATE TEXT SEARCH CONFIGURATION my_swedish ( COPY = swedish ); ALTER TEXT SEARCH CONFIGURATION my_swedish DROP MAPPING FOR hword_asciipart; ALTER TEXT SEARCH CONFIGURATION my_swedish DROP MAPPING FOR

How to correctly create thesaurus dictionary for my custom text search configuration

末鹿安然 提交于 2020-08-10 18:57:28
问题 I use PostgreSQL 11.8. And for Postgres, I use the docker image postgres:11-alpine . I want to create a custom full text search dictionary for expressions which are based on some words, like hello world should become hw . First of all I have a custom full text search configuration my_swedish : CREATE TEXT SEARCH CONFIGURATION my_swedish ( COPY = swedish ); ALTER TEXT SEARCH CONFIGURATION my_swedish DROP MAPPING FOR hword_asciipart; ALTER TEXT SEARCH CONFIGURATION my_swedish DROP MAPPING FOR

innodb_ft_min_token_size = 1 performance implications

前提是你 提交于 2020-08-07 04:21:06
问题 If I change innodb_ft_min_token_size =1 from default of 3, will this cause a lot more disk usage? Any performance issues with search? I want to be able to use fulltext search in 1 character in words. Also once I make this change how would I rebuild the index? Will this put a lot of load on server? 回答1: There are not that many 1- and 2- letter words, so the space change may not be that great. Modifying innodb_ft_min_token_size, innodb_ft_max_token_size, or ngram_token_size [in my.cnf] requires

MATCH & AGAINST in Java Spring Data JPA

筅森魡賤 提交于 2020-08-05 07:33:33
问题 I want to use this query: SELECT * FROM USER JOIN USER_CACHE ON USER.ID = USER_CACHE.ID WHERE MATCH (CACHE) AGAINST ( :someText ) > 0 inside the Predicate using Spring Data JPA with Root, CriteriaQuery and CriteriaBuilder classes and add the predicate to a list of predicates that I later condense. For a while i was using the CONTAINS function, however the database version I updated to no longer supports this procedure. Is what I am trying to achieve possible? I don't want to use a nativeQuery

MATCH & AGAINST in Java Spring Data JPA

无人久伴 提交于 2020-08-05 07:32:28
问题 I want to use this query: SELECT * FROM USER JOIN USER_CACHE ON USER.ID = USER_CACHE.ID WHERE MATCH (CACHE) AGAINST ( :someText ) > 0 inside the Predicate using Spring Data JPA with Root, CriteriaQuery and CriteriaBuilder classes and add the predicate to a list of predicates that I later condense. For a while i was using the CONTAINS function, however the database version I updated to no longer supports this procedure. Is what I am trying to achieve possible? I don't want to use a nativeQuery

MATCH & AGAINST in Java Spring Data JPA

大憨熊 提交于 2020-08-05 07:32:05
问题 I want to use this query: SELECT * FROM USER JOIN USER_CACHE ON USER.ID = USER_CACHE.ID WHERE MATCH (CACHE) AGAINST ( :someText ) > 0 inside the Predicate using Spring Data JPA with Root, CriteriaQuery and CriteriaBuilder classes and add the predicate to a list of predicates that I later condense. For a while i was using the CONTAINS function, however the database version I updated to no longer supports this procedure. Is what I am trying to achieve possible? I don't want to use a nativeQuery

MySQL Error 1032 “Can't find record in table”

血红的双手。 提交于 2020-08-05 04:58:49
问题 I asked this question yesterday on dba.stackexchange.com and didn't get any responses, so I'm trying here. I'm getting MySQL 1032 "Can't find record in 'person'" errors for some queries in my database, and I cannot resolve them. Here's the table: CREATE TABLE `person` ( `id` int(11) NOT NULL AUTO_INCREMENT, `last_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `title`