Keep receiving "no such column" error in my fts4 code. Trying to make a search table for an app

23 views Asked by At

I'm trying to make an search function for a dictionary app with fts4, but when I type things into the search function nothing comes up. When I look at the expo errors, I see: enter image description here "no such column: rank (code 1 SQLITE_ERROR[1}:, while compiling..."

This is the code that it comes from

 if (text) {
  db.transaction((tx) => {
    tx.executeSql(
      "SELECT * FROM words_fts4 WHERE " + this.state.searchLangColumn + " MATCH '" + text + "*' COLLATE Latin1_general_CI_AI  ORDER BY rank;",
      null,
      (txObj, { rows: {_array} }) => { 
      this.setState({ searchResults: _array });
      this.removeNA();
    },
      (txObj, error) => console.log("Error ", error)
    );
  });
} else {
  this.setState({ searchResults: [] });
}

};

could someone please help me out? Thanks.

I'm new to using fts4, so I tried messing around with the syntax, but I'm pretty sure it's some other error. There is also a "cannot read properly 'useSyncExternalStore' of null" error, but I'm not sure how to fix that either.

0

There are 0 answers