Skip to main content
Question

Can we integrate Lucene with Vertica for text search?

  • October 6, 2019
  • 1 reply
  • 9 views

mosheg
Forum|alt.badge.img+2
  • Participating Frequently

Did anybody try to integrate Lucene library with Vertica as shown here?
https://github.com/luceneplusplus/LucenePlusPlus
Did anybody try the following with Vertica?
https://dzone.com/articles/lucene-database-oracle-five
We have a table name rawdata.forecasting_system with 493,900,272 rows.
Each row include a field name pv_userSegmentsInfo_uddIds varchar(10000) with about 200 integers separated with a comma.
All together we have about 50K unique numbers, with returns the total is more than 100 billion appearances as shown here:
SELECT count(words) from
(SELECT v_txtindex.StringTokenizerDelim(pv_userSegmentsInfo_uddIds,',')
OVER (PARTITION BY pv_pageViewKey_pageViewUniqueId ORDER BY pv_pageViewKey_pageViewUniqueId)
FROM rawdata.forecasting_system) foo;
count
--------------
100666594134
(1 row)

Vertica current text index is not fast enough, and its inherent sort restrictions break other fields tuning requirements. Also manual index nor regexp search like the following is not fast
like MEMSQL with Lucene.
select xyz from forecast.forecasting_system
where pv_countryCode = 'US' AND pv_userSegmentsInfo_uddIds like '%,158354,%';
as part of several levels of GBY

1 reply

Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • October 7, 2019

Does the forecasting_system table include a PK? Is the value in pv_userSegmentsInfo_uddIds always integer or numeric?
To solve a similar problem in MS-SQL in the now-distant past, I expanded the CSV field into a lookup table of (MAINTABLE_PK, MAINTABLE_CSV) with the CSV expanded into rows per PK from the main table. Then I built an index on the lookup table - order by CSV, PK I think with main table index sorted on PK. For Vertica you should be able to do similar and a projection on a int/numeric type should be quite fast compared to any text index.