Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Query compilation with empty indices is buggy #133

Copy link
Copy link
@bolerio

Description

@bolerio
Issue body actions

The query conditions -> query execution translation code will take a short cut and construct a NOP (no operation) query which always returns an empty result set. When a query with variables is compiled prior to any data making its way into the indices, the resulting query executor never picks up on the new data because of that optimization.

The solution is to optimize only when the query expression has no varaibles in it. Example problematic code is the AtomTypeCondition convereter in ToQueryMap which has this logic:

			public HGQuery<?> getQuery(final HyperGraph graph, HGQueryCondition c)
			{				
				final AtomTypeCondition ac = (AtomTypeCondition)c;
				if (!hg.isVar(ac.getTypeReference()) && ac.getTypeHandle() == null &&
						graph.getTypeSystem().getTypeHandleIfDefined(ac.getJavaClass()) == null)
					return HGQuery.NOP();
				return new SearchableBasedQuery(graph.getIndexManager().getIndexByType(), 
etc....
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.