full-text-search

Find sentences with two words adjacent to each other in Pg

一曲冷凌霜 提交于 2020-01-05 09:18:58
问题 I need help crafting an advanced Postgres query. I am trying to find sentences with two words adjacent to each other, using Postgres directly, not some command language extension. My tables are: TABLE word (spelling text, wordid serial) TABLE sentence (sentenceid serial) TABLE item (sentenceid integer, position smallint, wordid integer) I have a simple query to find sentences with a single word: SELECT DISTINCT sentence.sentenceid FROM item,word,sentence WHERE word.spelling = 'word1' AND item

fulltext search not returning total count

孤街浪徒 提交于 2020-01-05 09:04:45
问题 Desperate for help on this, please help! I am running a fulltext search with mysql. My data is held in two tables, so I have to run separate matches on each table and add the relevancy together as you can see in my MySQL statement. The problem is that I am trying to get a COUNT for the total posts a question has in my post table. However this is only returned to me when the match is found in the question table, not if the match is found in the posts table? Any idea why? Please tell me in more

Lucene 2.4.0 Range Query is not working as expected

守給你的承諾、 提交于 2020-01-05 09:02:54
问题 Below are the indexed fields with value: EffectiveDate="1970" ExpirationDate="2035" Code to create index and seach: public class IndexTest{ static Analyzer analyzer = new StandardAnalyzer(); static IndexSearcher isearcher; @BeforeClass public static void createIndex() throws CorruptIndexException, LockObtainFailedException, IOException{ Store s = Field.Store.YES; Store ds = Field.Store.YES; Index IA = Field.Index.ANALYZED; Index INA = Field.Index.NOT_ANALYZED; IndexWriter iwriter = new

reverse phrase search in zend lucene

六眼飞鱼酱① 提交于 2020-01-05 08:27:56
问题 Basically I have two tables Location and city , The city has city_name and country_code. location_name field from location table has locations. I want to find the location country. My table structure. City table City country_code city_name US Kansas city ......... (thousands of world country cities) Location table Location location_name Kansas city, mo Kansas city Kansas city, us uSA, Kansas city etc... So I Indexed the two fields(country_code and city_name) in city table using Zend Lucene

Does the phrase search operator <-> work with JSONB documents or only relational tables?

一曲冷凌霜 提交于 2020-01-05 08:10:59
问题 Does the phrase search operator <-> work with JSONB documents or only relational tables in PostgreSQL? I haven't experimented with this yet, as I haven't yet set up Postgres hosting. The answer to this question will help determine what database and what tools I will be using. I found this sample code at: https://compose.com/articles/mastering-postgresql-tools-full-text-search-and-phrase-search/: SELECT document_id, document_text FROM documents WHERE document_tokens @@ to_tsquery('jump <->

Django 2 + PostgreSQL FullText search not matching what it should

∥☆過路亽.° 提交于 2020-01-05 07:41:29
问题 I am experiencing a problem I hope someone can enlighten me about. I need to perform a full-text search on a table with multiple columns and sorting the results by rank, using Django 2 and PostgreSQL 10.1. So far this is my code: from django.contrib.postgres.search import SearchQuery, SearchRank, SearchVector # other unrelated stuff here vector = SearchVector("very_important_field", weight="A") + \ SearchVector("tags", weight="A") + \ SearchVector("also_important_field", weight="B") + \

How can I grab each page of text in a Word doc separately (using .NET)?

ぃ、小莉子 提交于 2020-01-05 05:05:45
问题 I need to determine which pages of a Word document that a keyword occurs on. I have some tools that can get me the text of the document, but nothing that tells me which pages the text occurs on. Does anyone have a good starting place for me? I'm using .NET Thanks! edit: Additional constraint: I can't use any of the Interop stuff. edit2: If anybody knows of stable libraries that can do this, that'd also be helpful. I use Aspose, but as far as I know that doesn't have anything. 回答1: This is how

Full Text Search result similar to Mysql Like '%%' query

混江龙づ霸主 提交于 2020-01-05 04:17:11
问题 We are looking for mysql query which provide result exactly like '%%' query but using full text search MATCH AGAINST For example Select id,name from table where jobtitle like '%java software engineer in google%' It gives all rows which contain line java software engineer in google But if we use following mysql query then it gives a different result Select id,name from table where MATCH(jobtitle) AGAINST ('+java software engineer in google' IN BOOLEAN MODE) It gives rows which contain any word

CouchDB Full Text Search

左心房为你撑大大i 提交于 2020-01-05 02:24:11
问题 i need some direction about full text search in couchdb. Is it already enabled by default in 2.0, or do we have to rebuild couchdb enabling it? Scenario: It is a document management system, documents are shown in a grid. I need to be able to sort results. After several changes from map reduces to elastic indexes, now i am trying to use mango queries. Problem is that sorting does not give the expected results. { "selector": { "directoryName": { "$eq": "mail\\test\\inbox" }}, "sort": [{"subject

Fulltext Search in SQL Server 2008 Step by step

本小妞迷上赌 提交于 2020-01-04 06:51:11
问题 How to get started with Fulltext Search in SQL Server 2008 回答1: read these links: SQL SERVER – 2008 – Creating Full Text Catalog and Full Text Search Using Full Text Search in SQL Server 2008 Setting Up Full Text Search: A Step-by-step Guide Full-Text Search (SQL Server) SQL Server 2008 Full Text Search Best Practices from the SQL CAT Team 回答2: I would add those links from Simple Talk's web site: Understanding Full-Text Indexing in SQL Server SQL Server Full Text Search Language Features SQL