Hello, team. Is there any simple way to make exist...
# advice-metadata-modeling
c
Hello, team. Is there any simple way to make existing field in aspect searchable? for example, Dataset.viewProperties.viewLogic? Found something here https://datahubproject.io/docs/metadata-modeling/extending-the-metadata-model/#annotating-collections--annotation-overrides
b
hey Nikita! yup you found the right place - if you place the
@Searchable
annotation above the field that you want to be discoverable by search in the pdl file and then follow the docs you posted above and some more info about
@Searchable
specifically in these docs then you should be good!
note that after applying the annotation, you need to rebuild and restart your GMS instance, then all new data will be indexed for search. you can always restore indices to add search indices for existing data as well
c
@bulky-soccer-26729 thx. I will try
Hello @bulky-soccer-26729. I do some changes to pdl files, rebuild and restart GMS, restore indices but i don't see expected result :( Is there any way to check current schema metadata in running GMS container?
b
hmm weird.. do you mind sharing your pdl changes here? also yup! if you want to look directly at what elasticsearch is storing to see if your indices are getting updated with your new annotation changes, I would suggest using elasticvue (what the core datahub team uses internally) and then if you want to see your database contents to ensure the data you expect to be there is there you can always use something like sequel-ace
c
diff in attachment https://github.com/datahub-project/datahub/blob/198c86a6209e4c71679397ad5e5e93e560[…]models/src/main/pegasus/com/linkedin/dataset/ViewProperties.pdl
Copy code
namespace com.linkedin.dataset

import com.linkedin.common.Urn

/**
 * Details about a View. 
 * e.g. Gets activated when subTypes is view
 */
@Aspect = {
  "name": "viewProperties"
}
record ViewProperties {

  /**
   * Whether the view is materialized
   */
  @Searchable = {
    "fieldType": "BOOLEAN",
    "weightsPerFieldValue": { "true": 0.5 }
  }
  materialized: boolean

  /**
   * The view logic
   */
  viewLogic: string

  /**
   * The view logic language / dialect
   */
  @Searchable = {
    "fieldType": "TEXT",
    "queryByDefault": true
  }
  viewLanguage: string

}
OMG
i want to search by viewLogic, but add searchable to viewLanguage. nevermind, thx a lot )
b
There we go! Haha of course, happy to help