GithubHelp home page GithubHelp logo

Comments (8)

barryhunter avatar barryhunter commented on July 25, 2024

They seem to work in limited testing done.

What I dont understand is the point of adding fields/attributes to the percolate index. Its specifally mentioned can reconfigure the index. But not sure why, or how to use it added fields

I initially thought it was so could additionally filter the queries in SELECT (kinda like the buiult in tags column) but that doesnt seem to be the case.

The docs shows adding a json atgtribute. But HOW would you use it? Can use the extra fields/attributes in INSERT, in the SELECT, or in the CALL PQ? (dont know)

... just offering this as a part that dont think explained very well in the docs.

from manticoresearch.

barryhunter avatar barryhunter commented on July 25, 2024

btw, the blog post does appear to include an example. where the fields/attributes on the index, seem to be what can use in @field syntax and Filters on queries.

So is it that need to explicitly add fields/attributes to the index, BEFORE can INSERT a query into the index, AND/OR before can run a CALL PQ query (including the columns in the JSON 'document') ?

from manticoresearch.

tomatolog avatar tomatolog commented on July 25, 2024

You might use attributes to filter out some documents and fields to constrain query terms.

On INSERT query got transformed to node tree and query field operators out of schema got dropped. However on index reconfigure all queries again got transformed to node tree from initial text representation.

Same for attributes. On issue matching with CALL PQ attributes our of schema got dropped and attributes these not mention at CALL PQ got their default values. Then on matching for query with filters document(s) got rejected in case it failed to pass query filters.

from manticoresearch.

tomatolog avatar tomatolog commented on July 25, 2024

the syntax is same as SphinxQL for @field and filters

INSERT INTO pq_filter (query, filters) VALUES ( 'filter test', 'gid >= 10' );
INSERT INTO pq_filter (query, filters) VALUES ( 'filter test', 'gid >= 10 OR gid <= 3' );
CALL PQ ('pq_filter', ('{"title":"filter test doc1", "gid":2 }', '{"title":"filter test doc2", "gid":13}'), 1 as docs, 1 as docs_json );

from manticoresearch.

barryhunter avatar barryhunter commented on July 25, 2024

So the 'columns' used in CALL PQ documents (title and gid - in your sample) - need to be defined as either field or attributes in the index itself. Thats the bit that not clear to me at least.

The text field showing in a DESCRIBE pqindex is just a single field, so that 0 AS docs_json, a single string for the document is assigned a field name.

from manticoresearch.

tomatolog avatar tomatolog commented on July 25, 2024

I took example from test_321 there index declaration is

index pq_filter
{
	type = percolate
	path = data/pq_filter
	rt_field = title
	rt_attr_uint = gid
}

without docs_json option you can not map documents to different fields as stated into documentation
Fields and attributes mapping are allowed for JSON documents only.
without docs_json parser assigns fields from document with index schema defined order.

We implementing HTTP interface for PQ it will be json based and no need to encode \ decode json objects into string as you have to with SphinxQL

from manticoresearch.

airolg avatar airolg commented on July 25, 2024

Note about Percolate Query preformance Manticoresearch vs. Elasticsearch
http://bit.ly/2nLSpqJ
default

from manticoresearch.

airolg avatar airolg commented on July 25, 2024

Done, thank you

from manticoresearch.

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.