SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Using full text search in OpenERP
Holger Brunn
Therp BV
03 july 2013
Intro PostgreSQL full text search capabilities OpenObject FTS
Outline
1 Intro
2 PostgreSQL full text search capabilities
3 OpenObject FTS
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Searching content of text fields is
very slow for large amounts of data
finds only fields containing the exact string
you filled in
restricted to just this string
Full text search gives us
fast searches
lexeme level fuzzy search
logical operators
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Demo
imported part of the project gutenberg database as
documents
10.000 books, every one as its own document,
resulting in a lot of text in different languages
doing several searches there with standard OpenERP
search makes you a serious coffee addict
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Basics
documents are the lump of text you are searching through
tokens are parts of a document: words, but also i.e. urls,
numbers
lexemes are roughly the core of a word: ‘searching’,
‘search’, ‘searched’ are all derived from the
lexeme SEARCH
stop words are words that don’t make sense to store and are
to be ignored, think of ‘the’
dictionaries define lexemes, synonyms and stop words of a
language
more info http://www.postgresql.org/docs/current/
static/textsearch.html
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Basics II
tsvector is the datatype postgres uses to represent a
tokenized, lexemized text
tsquery is the datatype to represent a query against a
tsvector, with operators
‘&’ and
‘|’ or
‘!’ not
‘(’, ‘)’ brackets
:* substring search
@@ is the operator to match a tsquery against a
tsvector
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Examples
select to tsvector(’english’, ’This is an english text. Pay
attention how it is broken up’);
select to tsvector(’french’, ’This is an english text. Pay
attention how it is broken up’);
select plainto tsquery(’english’, ’this’);
select plainto tsquery(’french’, ’this’);
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Untouched topics
ranking
highlighting
proximity search
parser tuning
dictionary tuning
configurations
index tuning
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Full text search support for OpenERP
is available on launchpad:
https://launchpad.net/openobject-fts
is a collection of addons that enable full text search for
several models
takes care of creating appropriate indexes and triggers for
underlying database tables and columns
can be misused to provide a unified search over several
models
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Installation / Configuration
on installation, a cronjob is created to create the initial
index
watch your logs, there is an info on when index creation
starts and when it ends
only then, this model is searchable via full text search
this can take hours if you have enough data
the initial configuration is ‘simple’, this won’t get you
good results
set the parameter fts base tsconfig to english, french, etc.
to change that
then go to Configuration / Fulltextsearch configuration to
recreate the index
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Hacking it
depend on fts base
inherit fts base
set properties model and indexed column
the class fts base is extensively documented, read that
note that this are not ORM models
to change the combined search view, inherit fts.proxy’s
search view
Holger Brunn Therp BV
Using full text search in OpenERP
Intro PostgreSQL full text search capabilities OpenObject FTS
Contributions welcome
hook into search methods of full text indexed models to
also use the full text search in their own searches
hook into fts.proxy’s treeview and override edit/form
actions to get rid of the awkward extra buttons currently
used
hack 7.0’s search widget to propose lexemes as you type
dig deeper into caching mechanisms for smoother scrolling
query available configurations from postgres and offer
then in the confguration wizard
Holger Brunn Therp BV
Using full text search in OpenERP

Más contenido relacionado

Más de Odoo

Más de Odoo (20)

Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting CapabilityExtending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
 
Managing Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooManaging Multi-channel Selling with Odoo
Managing Multi-channel Selling with Odoo
 
Product Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseProduct Configurator: Advanced Use Case
Product Configurator: Advanced Use Case
 
Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?
 
Rock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced OperationsRock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced Operations
 
Transition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organizationTransition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organization
 
Synchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the CrisisSynchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the Crisis
 
Running a University with Odoo
Running a University with OdooRunning a University with Odoo
Running a University with Odoo
 
Down Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in OdooDown Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in Odoo
 
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach foodOdoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
 
Migration from Salesforce to Odoo
Migration from Salesforce to OdooMigration from Salesforce to Odoo
Migration from Salesforce to Odoo
 
Preventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine LearningPreventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine Learning
 
Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification
 
Instant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping LabelInstant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping Label
 
How Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 FoldHow Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 Fold
 
From Shopify to Odoo
From Shopify to OdooFrom Shopify to Odoo
From Shopify to Odoo
 
Digital Transformation at Old MacDonald Farms: A Personal Story
Digital Transformation at Old MacDonald Farms: A Personal StoryDigital Transformation at Old MacDonald Farms: A Personal Story
Digital Transformation at Old MacDonald Farms: A Personal Story
 
An all in-one Engineer-to-Order (ETO) Solution with Odoo
An all in-one Engineer-to-Order (ETO) Solution with OdooAn all in-one Engineer-to-Order (ETO) Solution with Odoo
An all in-one Engineer-to-Order (ETO) Solution with Odoo
 
Advanced Integrated HRMS and Appraisal System
Advanced Integrated HRMS and Appraisal SystemAdvanced Integrated HRMS and Appraisal System
Advanced Integrated HRMS and Appraisal System
 
Accounting using the Odoo Enterprise Swsiss Localization
Accounting using the Odoo Enterprise Swsiss LocalizationAccounting using the Odoo Enterprise Swsiss Localization
Accounting using the Odoo Enterprise Swsiss Localization
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Using full text search in OpenERP. Holger Brunn, Therp

  • 1. Using full text search in OpenERP Holger Brunn Therp BV 03 july 2013
  • 2. Intro PostgreSQL full text search capabilities OpenObject FTS Outline 1 Intro 2 PostgreSQL full text search capabilities 3 OpenObject FTS Holger Brunn Therp BV Using full text search in OpenERP
  • 3. Intro PostgreSQL full text search capabilities OpenObject FTS Searching content of text fields is very slow for large amounts of data finds only fields containing the exact string you filled in restricted to just this string Full text search gives us fast searches lexeme level fuzzy search logical operators Holger Brunn Therp BV Using full text search in OpenERP
  • 4. Intro PostgreSQL full text search capabilities OpenObject FTS Demo imported part of the project gutenberg database as documents 10.000 books, every one as its own document, resulting in a lot of text in different languages doing several searches there with standard OpenERP search makes you a serious coffee addict Holger Brunn Therp BV Using full text search in OpenERP
  • 5. Intro PostgreSQL full text search capabilities OpenObject FTS Basics documents are the lump of text you are searching through tokens are parts of a document: words, but also i.e. urls, numbers lexemes are roughly the core of a word: ‘searching’, ‘search’, ‘searched’ are all derived from the lexeme SEARCH stop words are words that don’t make sense to store and are to be ignored, think of ‘the’ dictionaries define lexemes, synonyms and stop words of a language more info http://www.postgresql.org/docs/current/ static/textsearch.html Holger Brunn Therp BV Using full text search in OpenERP
  • 6. Intro PostgreSQL full text search capabilities OpenObject FTS Basics II tsvector is the datatype postgres uses to represent a tokenized, lexemized text tsquery is the datatype to represent a query against a tsvector, with operators ‘&’ and ‘|’ or ‘!’ not ‘(’, ‘)’ brackets :* substring search @@ is the operator to match a tsquery against a tsvector Holger Brunn Therp BV Using full text search in OpenERP
  • 7. Intro PostgreSQL full text search capabilities OpenObject FTS Examples select to tsvector(’english’, ’This is an english text. Pay attention how it is broken up’); select to tsvector(’french’, ’This is an english text. Pay attention how it is broken up’); select plainto tsquery(’english’, ’this’); select plainto tsquery(’french’, ’this’); Holger Brunn Therp BV Using full text search in OpenERP
  • 8. Intro PostgreSQL full text search capabilities OpenObject FTS Untouched topics ranking highlighting proximity search parser tuning dictionary tuning configurations index tuning Holger Brunn Therp BV Using full text search in OpenERP
  • 9. Intro PostgreSQL full text search capabilities OpenObject FTS Full text search support for OpenERP is available on launchpad: https://launchpad.net/openobject-fts is a collection of addons that enable full text search for several models takes care of creating appropriate indexes and triggers for underlying database tables and columns can be misused to provide a unified search over several models Holger Brunn Therp BV Using full text search in OpenERP
  • 10. Intro PostgreSQL full text search capabilities OpenObject FTS Installation / Configuration on installation, a cronjob is created to create the initial index watch your logs, there is an info on when index creation starts and when it ends only then, this model is searchable via full text search this can take hours if you have enough data the initial configuration is ‘simple’, this won’t get you good results set the parameter fts base tsconfig to english, french, etc. to change that then go to Configuration / Fulltextsearch configuration to recreate the index Holger Brunn Therp BV Using full text search in OpenERP
  • 11. Intro PostgreSQL full text search capabilities OpenObject FTS Hacking it depend on fts base inherit fts base set properties model and indexed column the class fts base is extensively documented, read that note that this are not ORM models to change the combined search view, inherit fts.proxy’s search view Holger Brunn Therp BV Using full text search in OpenERP
  • 12. Intro PostgreSQL full text search capabilities OpenObject FTS Contributions welcome hook into search methods of full text indexed models to also use the full text search in their own searches hook into fts.proxy’s treeview and override edit/form actions to get rid of the awkward extra buttons currently used hack 7.0’s search widget to propose lexemes as you type dig deeper into caching mechanisms for smoother scrolling query available configurations from postgres and offer then in the confguration wizard Holger Brunn Therp BV Using full text search in OpenERP