Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
336 views
in Technique[技术] by (71.8m points)

database - How can I identify this "search syntax" or "query language"?

Can anyone identify this 'search syntax' or 'query language' ? I am looking for a more complete specification.

  • There is one operator: =
  • All strings are case-insensitive, limited to 7-bit
  • Whitespace is significant
  • Queries are of the form: column=value
  • & is a query seperator, leading to column1=value1&column2=value2 for an INTERSECTION
  • Data typing is implicit, and has at least strings, booleans, and positive decimal values
  • Positive decimal numbers have syntax similar to the following:
    • value=-10.0 returns all results with value less-than-or-equal to 10
    • value=10+ returns all results with value greater-than-or-equal to 10
    • value=1:10.0 returns all results between 1 and 10, inclusively
  • Booleans:
    • False can be represented as : bool=0,bool=f,bool=false
    • True can be represented as: bool=0, bool=t,bool=true
  • Strings:
    • Do not need to be wrapped in quotes, quotes are ignored
    • ? is a single-character wildcard, * is a multi-character (can be empty) wildcard

What I've looked at so far:

  1. Lucene, which uses : for seperator, and is more complex syntatically
  2. SQL where-clauses which use far more extensive operators
  3. HQL and .QL (and others from Wikipedia's query pages) - however, this is significantly less object based.

Given the complexity, including implicit type conversions, I don't believe this was a home-grown DSL.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...