SlideShare a Scribd company logo
1 of 12
Download to read offline
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

More Related Content

More from Odoo

More from 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
 

Recently uploaded

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

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