1

When designing search forms for websites, I always think of name for the variable that contains the text that user is searching for. The form often contains additional filters like date range or categories. The data collected from user looks like this (programmatically, JSON format):

var searchFilters = {
  "dateFrom": "2015-04-29",
  "dateTo": "2015-06-30",
  "categoryIds": [1, 2, 3],
  "THE TEXT THAT USER HAS ENTERED": "I'm looking for John Doe"
}; 

How to name the THE TEXT THAT USER HAS ENTERED attribute? I have seen/used:

  • text
  • phrase
  • query
  • term

Which one is the most appropriate for this situation? Any other suggestions?

I suppose the query can be perceived as a good one but I do not like it. It clashes with database query. One would have to say that the application executes database query to find results for user query which is odd.

5
  • searchTerm and queryTerm are the general names used Commented May 4, 2016 at 19:36
  • I don't think this is fit for ELU. But I could be wrong, though.
    – NVZ
    Commented May 4, 2016 at 19:38
  • This is opinion based and is too broad.
    – vickyace
    Commented May 4, 2016 at 19:51
  • Please read "What topics can I ask about here?" at english.stackexchange.com/help/on-topic, which says "please, don’t ask any questions about the following topics. They are out of scope for this site. ... Naming".
    – TrevorD
    Commented May 4, 2016 at 23:36
  • 4
    I'm voting to close this question as off-topic because questions about naming are off-topic.
    – TrevorD
    Commented May 4, 2016 at 23:37

1 Answer 1

2

input would be one of the correct terms since it simply means anything that the user puts into the search bar, such as a phrase, term, query, and all other things the user would be searching for.

Not the answer you're looking for? Browse other questions tagged or ask your own question.