Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jHX6i-0005HM-5b for pgsql-general@arkaria.postgresql.org; Thu, 26 Mar 2020 18:19:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHX6f-0007JG-0Y for pgsql-general@arkaria.postgresql.org; Thu, 26 Mar 2020 18:19:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHX6e-0007J8-Kn for pgsql-general@lists.postgresql.org; Thu, 26 Mar 2020 18:19:52 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jHX6c-0001cb-C6 for pgsql-general@lists.postgresql.org; Thu, 26 Mar 2020 18:19:52 +0000 Received: by mail-wm1-x32f.google.com with SMTP id z5so7592242wml.5 for ; Thu, 26 Mar 2020 11:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=zQ1zywfLOFQkptmE8nfPuD2FqarUKLaLbgzQBPyG6nQ=; b=lBuAIEzkX9kFuK7ZpAMNjYG1xTTTOAA6R8V3ZdbGBJJkxW1g+ofZm29wLe/Otqxu9J U5L/Nf2YXUNvOVjjiUprFnlIae0fBoopESA73ouwmc1Q9h6DtBLquMMHzitzY4oHbSU6 nu3hqVJ5cbCtfCvKfIFRCTBSg+cWLzsqGEPm2xa4D962GuNsOk861GDi9Ncu+zNdiKOH HqSgrpZkrPWJ1Jiz0DSNrSxc05W8DEsDW/GB9UgwIf4+oIwcdpfFQ8053k4tibylyQ29 P3NEO9nNL36RB4sbe869X6uQ+tjf4AttW4UVy/0lSjqHjQPIrcVYX0OGPOel/jdgk+D8 VJkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zQ1zywfLOFQkptmE8nfPuD2FqarUKLaLbgzQBPyG6nQ=; b=W3yziwsSmMMgIwXJlr7fmMiiS033JsUXSfssfQmo4Af0wNLfW5/+uzHoTE+zs76ZKT VDbMFcZr9HbFU5xq7Vz8j0J+tQrsb/e2fNKR/nIh5cuW+VNcAiys1Do6aTSWDvZ+x3NO Q9trQzsUu/5+yullHs+MzRR2oGy+whwccdbRrHawxXNUU7U4o7XDUF9xXoMqeuVjfQVr p0HJ0mBUsCZdalM69LlMkFp12DxRBnHFu/7jR5GlWmEXjeOQDTT0HopX30YhklQn8lE0 Xs9tvVq3L4N7tfi99yiUCsyyQvkhJli6zPxDc/NzK/rqRIG7G0Cej5aI0g4lYQfKHqbU EorA== X-Gm-Message-State: ANhLgQ2yDAVK+HRVEq7zSSEZHAuI2xT3LhCc/hmU3mVH7Tyec1W5VCaB UxfU7J6hYQ1mrgTbp+o5oM6XFdU3fWA= X-Google-Smtp-Source: ADFU+vsvNnqh5rgVImFSlKYeBSpI25RHM9/I81H/BRVbmyt81LEccPPearpidQSSJiTN4mxKeDEqww== X-Received: by 2002:a7b:ce96:: with SMTP id q22mr1294930wmj.134.1585246784634; Thu, 26 Mar 2020 11:19:44 -0700 (PDT) Received: from linux.laptop (p200300CA5F0EE6000310F36FC4294319.dip0.t-ipconnect.de. [2003:ca:5f0e:e600:310:f36f:c429:4319]) by smtp.gmail.com with ESMTPSA id p13sm4733409wru.3.2020.03.26.11.19.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Mar 2020 11:19:43 -0700 (PDT) Subject: Re: Replacing Apache Solr with Postgre Full Text Search? To: pgsql-general@lists.postgresql.org References: From: Artjom Simon Message-ID: <9d736364-0156-0a4d-d00f-bd5e8520ebb0@gmail.com> Date: Thu, 26 Mar 2020 19:19:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 26.03.20 17:05, J2eeInside J2eeInside wrote: >> P.S. I need to index .pdf, .html and MS Word .doc/.docx files, is >> there any constraints in Ful Text search regarding those file types? > > - Can you recommend those tools you mention above/any useful resource on how to do that? For PDFs, I know of at least two tools that can extract text. Try Ghostscript: gs -sDEVICE=txtwrite -o output.txt input.pdf or a tool called 'pdftotext': pdftotext [options] [PDF-file [text-file]] Both give slightly different results, mainly in terms of indentation and layout of the generated plain text, and how they deal with tabular layouts. Note that PDF is a container format that can embed virtually anything: text, images, flash videos, ... You'll get good results if the PDF input is plain text. If you're dealing with embedded images like scanned documents, you'll probably need a OCR pass with tools like 'tesseract' to extract the recognized text. You'll need similar tools to extract the text from DOC and HTML files since you're only interested in their plain text representation, not the meta data and markup. Finding converters from HTML/DOC to plain text shouldn't be too hard. You could also try to find a commercial document conversion vendor, or try to convert HTML and DOC both to PDF so you'll only have to deal with PDF-to-text extraction in the end. Good luck! Artjom -- Artjom Simon