Re: Simple sql query with where clause doesn't work

2017-04-08 Thread Joel Bernstein
Which version of Solr are you working with? Solr 6.5 has different SQL
engine the 6.0 through 6.4. Also what are field types you are working with
in the where clause?

Here is SQL query from the test cases in 6.4:
select id, Field_i, Str_s from Collection1 where Text_t='' order by
Field_i desc"

This shows a where clause with on text field.



Joel Bernstein
http://joelsolr.blogspot.com/

On Fri, Apr 7, 2017 at 3:05 PM, lazarusjohn  wrote:

> Did you find answer I getting same error when I use text instead of number
> in
> Where clause - Please let me know.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Simple-sql-query-with-where-clause-doesn-t-
> work-tp4324498p4328991.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: Simple sql query with where clause doesn't work

2017-04-07 Thread lazarusjohn
Did you find answer I getting same error when I use text instead of number in
Where clause - Please let me know.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Simple-sql-query-with-where-clause-doesn-t-work-tp4324498p4328991.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Simple sql query with where clause doesn't work

2017-03-12 Thread Erick Erickson
This has really nothing to do with SQL. What's happening is that the
query doesn't think you're specifying a field and it's looking for
_text_ which will be defined in your solrconfig file with a "df"
parameter for the query handler.

That said, the query appears malformed or it's a cut/paste error. You
use single quotes to open and a double quote to close:
 'stmt=select fieldA from collection where field='123''
you probably want something like
"stmt=select fieldA from collection where field='123' ''
Best,
Erick

On Sun, Mar 12, 2017 at 6:33 AM, adfel70  wrote:
> Seems like this only happend when the value is not a number
>
>
> curl --data-urlencode 'stmt=select fieldA from collection where field='123''
> http://host:port/solr/collection/sql?aggregationMode=facet
>
> works.
> while this one doesnt work:
>
> curl --data-urlencode 'stmt=select fieldA from collection where field='abc''
> http://host:port/solr/collection/sql?aggregationMode=facet
>
> Again, the same message with "no field name specified in query and no
> default specified via df param".
>
> tried this on multiple field types.
> example of field settings: type=string, indexed=true, stored=true,
> omitNorms=true, multiValued=false, docValues=true.
>
> Note that this collection was indexed as nested documents, but while trying
> the sql, I'm not using anything related to the nested format (except that
> the data itself was indexed this way)
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Simple-sql-query-with-where-clause-doesn-t-work-tp4324498p4324499.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Simple sql query with where clause doesn't work

2017-03-12 Thread adfel70
Seems like this only happend when the value is not a number


curl --data-urlencode 'stmt=select fieldA from collection where field='123''
http://host:port/solr/collection/sql?aggregationMode=facet

works.
while this one doesnt work:

curl --data-urlencode 'stmt=select fieldA from collection where field='abc''
http://host:port/solr/collection/sql?aggregationMode=facet

Again, the same message with "no field name specified in query and no
default specified via df param".

tried this on multiple field types.
example of field settings: type=string, indexed=true, stored=true,
omitNorms=true, multiValued=false, docValues=true.

Note that this collection was indexed as nested documents, but while trying
the sql, I'm not using anything related to the nested format (except that
the data itself was indexed this way)



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Simple-sql-query-with-where-clause-doesn-t-work-tp4324498p4324499.html
Sent from the Solr - User mailing list archive at Nabble.com.


Simple sql query with where clause doesn't work

2017-03-12 Thread adfel70
Hi
I'm trying to play with /sql feature.
working with solr 6.4.2

running
curl --data-urlencode 'stmt=select fieldA from collection'
http://host:port/solr/collection/sql?aggregationMode=facet

work fine.

running
curl --data-urlencode 'stmt=select fieldA from collection where
fieldB='value'' http://host:port/solr/collection/sql?aggregationMode=facet

doesn't work.
throws:
undefined field _text_

I dont have _text_ field in the schema but I also don't query on it so I'm
wondering what the problem is..

Thanks.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Simple-sql-query-with-where-clause-doesn-t-work-tp4324498.html
Sent from the Solr - User mailing list archive at Nabble.com.