New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST query returns no results when it should return some #469
Comments
I've seen this too when data is not found based on the direction of the |
I would tend to agree. As an oltp type system, we should not see this Im not sure if the issue has been classified yet. In my applications its Eric On Aug 28, 2016 4:37 AM, "Leo" notifications@github.com wrote:
|
The problem here is that the result of a FunctionProperty is of unknown type. There are two options to solve this problem:
Both approaches have advantages and disadvantages; right now, I'd prefer typed function properties, but I'd like to discuss that with the team. |
Hi @cmorgner, I see that a Function Property now being typed, but the problem still persists. Is there any update on this issue? |
Yes, you can give a function property a type hint now (string, integer, double, boolean etc., lower case), which should solve the typing problem. This has in fact become one of the things that need to be done in order to filter REST results with a function property. Another thing that came to my mind while reading the previous comments: re-indexing is only necessary when you add an indexed function property to existing data. For new objects, the indexed property should be handled correctly. Which version are you using? I am reasonably sure that REST queries on an indexed typed function property work correctly for quite some time now. Can you share the part of your data model and the corresponding query that doesn't work? |
Sorry for not mentioning it earlier, I'm using 3.5-SNAPSHOT, which I built myself. I've got a strange behavior on this one: it's working using StructrScript both on Pages and in concolse. Also it's working in console in REST mode, but the same (copy-pasted) query doesn't work in actual REST query. I've got
Query's like Btw, what's your preferred way to model or to read these kind of things? Like subtyping on schema level and using particular relationships for each kind of contacts? |
Just off the top of my head, the plus sign in the query string could have something to do with the problem, i.e. URL encoding (?). |
The preferred way depends very much on the different use cases for the data. The easiest (but least flexible) would be to store the most important info on the Customer node to make it easily queryable. Your approach is also quite good and much more flexible, but has the downside of having to use a lot of function properties. You could also use a custom result page for your own facetted search (which we have done many times in the past) to bypass the limitations of REST / query URLs. It's not easy to give good advice with little information. :) |
StructrScript function
filter()
works perfect and returns needed results, but REST returns no results when querying on computer properties (Function or Count).For example:
projectCount (Function):
size(this.projects)
projects (Function):
merge_unique(this.projectsRedundant)
projects (Notion):
skillRequests, projectProperty
(projectProperty
in remote attribute is another Notion property.)hasProjects (Function):
gt(this.projectCount,0)
REST query returns no results when querying on ?projectCount=1 or ?hasProjects=true, although querying without those parameters one can see in response that there are records with
And as I mentioned in the beginning of this issue, StructrScript function
filter()
works perfect and returns needed results.The text was updated successfully, but these errors were encountered: