Giter VIP home page Giter VIP logo

Comments (2)

kou avatar kou commented on May 24, 2024

Could you try this?

table_create ReportTags TABLE_HASH_KEY ShortText
# For full text search.
table_create ReportTagsIndex TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
# Text data exists in ReportTags._key. So --source of
# ReportTagsIndex.index_tags is "_key". We don't need WITH_SECTION
# because ReportTags._key is a scalar value.
column_create ReportTagsIndex index_tags COLUMN_INDEX|WITH_POSITION --type ReportTags --source _key

table_create Reports TABLE_HASH_KEY ShortText
column_create Reports tags COLUMN_VECTOR ReportTags

# For exact match. We add an index column to ReportTags.
# We don't need to create a new table for exact match
# against reference column.
# (Reports.tags's type is a table (ReportTags).)
# We don't need WITH_POSITION because this is
# not for a full text search. We don't need WITH_SECTION too because
# we don't need to care about offset in "Reports.tags" for exact match.
column_create ReportTags index_report COLUMN_INDEX Reports tags

load --table Reports
[
{"_key":"1","tags":["All News","sanctions","State-Sponsored","Hacktivist","South Korea","Maritime"]}
]

# You can see which index column is used by "select" in groonga.log.
# log_level debug

# Full text search. "._key" is important. ReportTagsIndex.index_tags
# is used.
select Reports --query tags._key:@korea

# Exact match. ReportTags.index_report is used.
select Reports --query tags:@sanctions

from groonga.

yssrku avatar yssrku commented on May 24, 2024

It works! I didn't know groonga can do tags._key, awesome!!

from groonga.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.